title: Mutable tree to persistent tree
body: <p>Learning Clojure (and Functional Programming) I have stumbled upon the problem of converting a mutable n-ary tree represented as nested <code>java.util.ArrayList</code>s into a persistent tree.</p>
  
  <p>Using non-functional programming you would normally create the tree from the root to the leaves. This does not seem to be possible using persistent data structures.</p>
  
  <p>Can someone show me how to construct an immutable tree given a mutable n-ary tree?</p>