docs: def node_to_dict(node):
      """
      Convert a Node object into a (nested) dictionary
      with attributes tag, attrib, text, nodes.
  
      :param node: a Node-compatible object
      """
      dic = dict(tag=striptag(node.tag))
      if node.attrib:
          dic['attrib'] = node.attrib
      if node.text is not None:
          dic['text'] = node.text
      if node.nodes:
          dic['nodes'] = [node_to_dict(n) for n in node]
      return dic