How can I enumerate all paths down a tree?
<p>I have a list</p>

<pre><code>list=[{"id":1},{"id":2,"children":[{"id":3},{"id":4},{"id":5,"children":[{"id":6}, {"id":7},{"id":8}]},{"id":9},{"id":10}]},{"id":11},{"id":12}]
</code></pre>

<p>Now how can i convert this list in below list format:</p>

<pre><code>[ [1], [2,3], [2,4], [2,5,6], [2,5,7], [2,5,8], [2,9], [2,10], [11], [12] ]
</code></pre>
