First batch of changes for serialization for entity objects.

Changes were tested for ProfilesService ( XML based service ).
Once this gets merged would checkin changes for other service ,
including JSON based services.