'Walk the etree XML node and fill in the asset metadata.
The node should be a top-level "asset" element.'

@contract(node='AssetElement')
def from_xml(self, node):

    for child in node:
        qname = etree.QName(child)
        tag = qname.localname
        if (tag in self.XML_ATTRS):
            value = child.text
            if (tag in self.XML_ONLY_ATTRS):
                continue
            elif (tag == 'locked'):
                value = (True if (value == 'true') else False)
            elif (value == 'None'):
                value = None
            elif (tag in ('created_on', 'edited_on')):
                value = dateutil.parser.parse(value)
            elif (tag in ('created_by', 'edited_by')):
                value = int(value)
            elif (tag == 'fields'):
                value = json.loads(value)
            setattr(self, tag, value)
