'Converts an XML element (its text, tag, and attributes) to dictionary form.
:param  element:    an XML ``Element``'

def element_as_dict(self, element):

    return {'tag': element.tag, 'text': (element.text.strip() if element.text else None), 'attrib': dict(element.attrib)}
