moved generate url logic to Xobject model