import json


def json_from_list(a_node_list, title):
    """ Returns json document with a list formated like:
    ["title", [{node1 dict},{node2 dict}] ]
    where node1, node2, .. are members of a_node_list
    """
    data = [title]
    list_of_node_dicts = []
    for n in a_node_list:
        list_of_node_dicts.append(n.to_dict())
    data.append(list_of_node_dicts)
    json_dump = json.dumps(data)
    return json_dump