'Creates a string representation of an entity.
Args:
entity: The entity to serialize.
Returns:
A serialized representation of an entity.'

def __SerializeEntity(self, entity):

    encoding = self.__EncodeEntity(entity)
    if (not isinstance(encoding, unicode)):
        encoding = unicode(encoding, 'utf-8')
    encoding = encoding.encode('utf-8')
    return encoding
