def to_dict_from_node(node, data_converter=None):
    """
    Converts the node structure into a dictionary.

    :type node: treestruct.Node
    :type data_converter: (Any) -> (Any) | None
    :rtype: list[dict]
    """

    data_converter = (lambda n: n) if data_converter is None else data_converter
    roots = node.roots() or [node]

    def _convert(n, converter):
        return {
            'data': converter(n.data),
            'children': [_convert(c, converter) for c in n.children]
        }

    return [_convert(root, data_converter) for root in roots]