title: DOMElement cloning and appending: 'Wrong Document Error'
body: <p>There's something I don't fully understand about node cloning with the PHP's DOM api.  Here's a sample file that quickly duplicates the issue I'm coming across.</p>
  
  <pre><code>$doc  = new DOMDocument( '1.0', 'UTF-8' );
  $root = $doc-&gt;createElement( 'root' ); // This doesn't work either $root = new DOMElement( 'root' );
  $doc-&gt;appendChild( $root );
  
  $doc2  = new DOMDocument( '1.0', 'UTF-8' );
  $root2 = $doc2-&gt;createElement( 'root2' );
  $doc2-&gt;appendChild( $root2 );
  
  // Here comes the error
  $root2-&gt;appendChild( $root-&gt;cloneNode() );
  </code></pre>
  
  <p>When you run this little snippet an exception is thrown</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception
    'DOMException' with message 'Wrong
    Document Error'</p>
  </blockquote>
  
  <p>Can I not grab a node from a document, clone it, and then append it to another document?</p>