@classmethod
def fromXmlString(cls, string, context, template=None):
    """Loads the object from an XML string.

        By default it assumes the derived class can be initialized from a string
        argument. If this is not the case, fromXmlString should be implemented.
        """
    value = cls(string)
    assert isinstance(value, cls
        ), 'Value returned by fromXmlString is not of required type %s' % str(
        cls)
    return value
