docs: def data(self, root):
          '''Convert etree.Element into a dictionary'''
  
          value = self.dict()
  
          # Add attributes specific 'attributes' key
          if root.attrib:
              value['attributes'] = self.dict()
              for attr, attrval in root.attrib.items():
                  value['attributes'][unicode(attr)] = self._fromstring(attrval)
  
          # Add children to specific 'children' key
          children_list = self.list()
          children = [node for node in root if isinstance(node.tag, basestring)]
  
          # Add root text
          if root.text and self.text_content is not None:
              text = root.text.strip()
              if text:
                  if self.simple_text and len(children) == len(root.attrib) == 0:
                      value = self._fromstring(text)
                  else:
                      children_list = [self._fromstring(text), ]
  
          for child in children:
              child_data = self.data(child)
              children_list.append(child_data)
  
          # Flatten children
          if len(root.attrib) == 0 and len(children_list) == 1:
              value = children_list[0]
  
          elif len(children_list) > 0:
              value['children'] = children_list
  
          return self.dict([(unicode(root.tag), value)])