<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fromXml(cls, xml):
 """ Restores an object from XML. :param xml | <xml.etree.ElementTree.Element> :return subclass of <XmlObject> """

        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