docs: def data(self, root):
          '''Convert etree.Element into a dictionary'''
          value = self.dict()
          children = [node for node in root if isinstance(node.tag, basestring)]
          for attr, attrval in root.attrib.items():
              attr = attr if self.attr_prefix is None else self.attr_prefix + attr
              value[attr] = self._fromstring(attrval)
          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:
                      value[self.text_content] = self._fromstring(text)
          count = Counter(child.tag for child in children)
          for child in children:
              if count[child.tag] == 1:
                  value.update(self.data(child))
              else:
                  result = value.setdefault(child.tag, self.list())
                  result += self.data(child).values()
          # if simple_text, elements with no children nor attrs become '', not {}
          if isinstance(value, dict) and not value and self.simple_text:
              value = ''
          return self.dict([(root.tag, value)])