Visits a :class:`CTENode` `node` and delegates to the (optional)
            `visitor` callback, as well as the (optional) `children` callback,
            in order to generate a dictionary representation of the node along
            with its children nodes.

            :param node: the :class:`CTENode` for which to generate the
                representation.

            :param visitor: optional function responsible for generating the
                dictionary representation of the node.

            :param children: optional function responsible for generating a
                children key and list for the node.

            :return: a dictionary representation of the structure of the node
                and its descendant tree.

def node_as_tree(
        self,
        node,
        visitor=lambda self, node: self._default_node_visitor(node),
        children=lambda self, node, visitor, children: self._default_node_children(
            node, visitor, children
        ),
    ):
        """ Visits a :class:`CTENode` `node` and delegates to the (optional)
            `visitor` callback, as well as the (optional) `children` callback,
            in order to generate a dictionary representation of the node along
            with its children nodes.

            :param node: the :class:`CTENode` for which to generate the
                representation.

            :param visitor: optional function responsible for generating the
                dictionary representation of the node.

            :param children: optional function responsible for generating a
                children key and list for the node.

            :return: a dictionary representation of the structure of the node
                and its descendant tree.
        """
        tree = visitor(self, node)
        tree.update(children(self, node, visitor, children))
        return tree