'Create object from XML'

@classmethod
def from_tree(cls, node):

    attrib = dict(node.attrib)
    for (key, ns) in cls.__namespaced__:
        if (ns in attrib):
            attrib[key] = attrib[ns]
            del attrib[ns]
    for el in node:
        tag = localname(el)
        if (tag in KEYWORDS):
            tag = ('_' + tag)
        desc = getattr(cls, tag, None)
        if (desc is None):
            continue
        if (tag in cls.__nested__):
            if hasattr(desc, 'from_tree'):
                if isinstance(desc, Sequence):
                    attrib.setdefault(tag, [])
                    attrib[tag].append(desc.from_tree(el))
                else:
                    attrib[tag] = desc.from_tree(el)
        else:
            if isinstance(desc, property):
                continue
            elif hasattr(desc.expected_type, 'from_tree'):
                obj = desc.expected_type.from_tree(el)
            else:
                obj = el.text
            if isinstance(desc, Sequence):
                if (tag not in attrib):
                    attrib[tag] = []
                attrib[tag].append(obj)
            else:
                attrib[tag] = obj
    return cls(**attrib)
