code: def to_json(self, value):
          
          if self._enable_enforce_type:
              value = self.enforce_type(value)
          return super(XMLString, self).to_json(value)
docs: Serialize the data, ensuring that it is valid XML (or None).
  
          Raises an lxml.etree.XMLSyntaxError if it is a basestring but not valid
          XML.