title: XML Clone node in PHP
body: <p>I have to clone an XML node and its childs and append it to a new XML in a specifics tag.</p>
  
  <p>Ie:</p>
  
  <p>Source XML:</p>
  
  <pre><code>&lt;root&gt;
    &lt;element&gt;
      &lt;back&gt;
      &lt;item1&gt;ABC&lt;/item1&gt;
      &lt;item2&gt;DEF&lt;/item2&gt;
      &lt;more&gt;
        &lt;moreitem&gt;GHI&lt;/moreitem&gt;
      &lt;/more
      &lt;/back&gt;
    &lt;/element&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Destination XML:</p>
  
  <pre><code>&lt;root&gt;
    &lt;base1&gt;
      &lt;item1&gt;FOO&lt;/item1&gt;
      &lt;item2&gt;BAR&lt;/item2&gt;
    &lt;base2&gt;
      **&lt;back&gt;From source XML and all its childs here&lt;/back&gt;**
    &lt;/base2&gt;
    &lt;/base1&gt;
  &lt;root&gt;
  </code></pre>