code: def fromXml(cls, xml):
          
          clsname = xml.get('class')
          if clsname:
              subcls = XmlObject.byName(clsname)
              if subcls is None:
                  inst = MissingXmlObject(clsname)
              else:
                  inst = subcls()
          else:
              inst = cls()
  
          inst.loadXml(xml)
          return inst
docs: Restores an object from XML.
  
          :param      xml | <xml.etree.ElementTree.Element>
  
          :return     subclass of <XmlObject>