title: SimpleXML: append one tree to another
body: <p>I have two XML trees and would like to add one tree as a leaf to the other one.</p>
  
  <p>Apparently:</p>
  
  <pre><code>$tree2-&gt;addChild('leaf', $tree1);
  </code></pre>
  
  <p>doesn't work, as it copies only the first root node.</p>
  
  <p>Ok, so then I thought I would traverse the whole first tree, adding every element one by one to the second one.</p>
  
  <p>But consider XML like this:</p>
  
  <pre><code>&lt;root&gt;
    aaa
    &lt;bbb/&gt;
    ccc
  &lt;/root&gt;
  </code></pre>
  
  <p>How do I access "ccc"? <code>tree1-&gt;children()</code> returns just "bbb"... .</p>