title: Building a menu tree from an adjacency list in Python
body: <p>Consider a basic adjacency list; a list of nodes represent by a Node class, with properties <code>id</code>, <code>parent_id</code>, and <code>name</code>. The parent_id of top-level nodes = None.</p>
  
  <p>What would be a Pythonic way of transforming the list into an un-ordered html menu tree, e.g.:</p>
  
  <ul>
    <li>
      node name
    </li>
    <li>
      node name
      <ul>
        <li>
          sub-node name
        </li>
        <li>
          sub-node name
        </li>
      </ul>
    </li>
  </ul>