title: Scala: Create structure (XML) from Lists of Lists
body: <p>I have a structure from java, a List &lt; List &lt; String > > containing
  elements like:</p>
  
  <pre><code>[[ "Node0", "Node00", "Leaf0"],
   [ "Node0", "Node00", "Leaf1"],
   [ "Node1", "Leaf2"],
   [ "Node0", "Leaf3"],
   [ "Node2", "Node20", "Node200", "Leaf4"]]
  </code></pre>
  
  <p>What I want to do is to create a XML structure (using Scala) in
  the most simple way, ending in something like the below.
  I could do this is many ways, iterating, recursive calls etc.</p>
  
  <p>Any suggestions for a compact readable way of solving this?</p>
  
  <pre><code>&lt;node&gt; Node0 
        &lt;node&gt; Node00 
              &lt;node&gt; Leaf0 &lt;/node&gt;
              &lt;node&gt; Leaf1 &lt;/node&gt;
        &lt;/node&gt;
        &lt;node&gt; Leaf3 &lt;/node&gt;
  &lt;/node&gt;
  &lt;node&gt; Node1
        &lt;node&gt; Leaf2 &lt;/node&gt;
  &lt;/node&gt;
  &lt;node&gt; Node2
        &lt;node&gt; Node20
              &lt;node&gt; Node200
                    &lt;node&gt; Leaf4 &lt;/node&gt;
              &lt;/node&gt;
        &lt;/node&gt;
  &lt;/node&gt;
  </code></pre>