Create a generalized dict output from this elem (default self.root).
        Rules:
        * Elements are objects with a single key, which is the tag.
            + if namespaces==True, the namespace or its prefix is included in the tag.
        * The value is an object:
            + '@name' = attribute with name="value", value is string
            + 'text' = text string
            + 'children' = children list, consisting of 0 or more text or element nodes:
                + text is represented as strings
                + elements are represented as objects
        * If ignore_whitespace==True, then whitespace-only element text and tail will be omitted.
        * Comments and processing instructions are ignored.
        * The "tail" of the given element (or XML.root) node is also ignored.

def as_dict(self, elem=None, ignore_whitespace=True, namespaces=True):
        """Create a generalized dict output from this elem (default self.root).
        Rules:
        * Elements are objects with a single key, which is the tag.
            + if namespaces==True, the namespace or its prefix is included in the tag.
        * The value is an object:
            + '@name' = attribute with name="value", value is string
            + 'text' = text string
            + 'children' = children list, consisting of 0 or more text or element nodes:
                + text is represented as strings
                + elements are represented as objects
        * If ignore_whitespace==True, then whitespace-only element text and tail will be omitted.
        * Comments and processing instructions are ignored.
        * The "tail" of the given element (or XML.root) node is also ignored.
        """
        if elem is None:
            elem = self.root
        tag = self.tag_dict_key(elem.tag, namespaces=namespaces)
        d = Dict(**{tag: {}})
        d[tag].update(
            **{
                '@' + self.tag_dict_key(k, namespaces=namespaces): elem.attrib[k]
                for k in elem.attrib.keys()
            }
        )
        nodes = []
        if elem.text is not None and (elem.text.strip() != '' or ignore_whitespace != True):
            nodes.append(str(elem.text))
        for ch in [
            e for e in elem.getchildren() if type(e) == etree._Element
        ]:  # *** IGNORE EVERYTHING EXCEPT ELEMENTS ***
            nodes.append(
                self.as_dict(elem=ch, ignore_whitespace=ignore_whitespace, namespaces=namespaces)
            )
            if ch.tail is not None and (ch.tail.strip() != '' or ignore_whitespace != True):
                d[tag].append(ch.tail)
        if nodes != []:
            d[tag]['nodes'] = nodes
        return d