title: Import Node into new Document
body: <p>I'm trying to import a node from a base-document into a new document but when I use the Document.importNode() method, it generates an exception. The funny part is that this exception does not contain a message so I'm pretty much blind except for the stack-trace. (I'm new to java)</p>
  
  <p>Here is my method that will create a new document and import the node:</p>
  
  <ul>
  <li>this.Builder = DocumentBuilder</li>
  <li>this.Element = Node</li>
  </ul>
  
  <p>Code:</p>
  
  <pre><code>public XMLSelection extract ()
  {
      if (this.Element != null)
      {
          try
          {
              Document newDoc = this.Builder.newDocument();
              Node node = newDoc.importNode(this.Element, true);
  
              newDoc.appendChild(node);
              return new XMLSelection(newDoc);
          }
          catch(Exception e)
          {
              Debug.error("XMLSelection::extract", e);
          }
      }
      return null;
  }
  </code></pre>
  
  <p>And the stack-trace:</p>
  
  <pre><code>02-06 14:27:53.328: W/System.err(9082): org.w3c.dom.DOMException
  02-06 14:27:53.328: W/System.err(9082):     at org.apache.harmony.xml.dom.NodeImpl.setNameNS(NodeImpl.java:227)
  02-06 14:27:53.328: W/System.err(9082):     at org.apache.harmony.xml.dom.ElementImpl.(ElementImpl.java:50)
  02-06 14:27:53.328: W/System.err(9082):     at org.apache.harmony.xml.dom.DocumentImpl.createElementNS(DocumentImpl.java:336)
  02-06 14:27:53.328: W/System.err(9082):     at org.apache.harmony.xml.dom.DocumentImpl.shallowCopy(DocumentImpl.java:156)
  02-06 14:27:53.328: W/System.err(9082):     at org.apache.harmony.xml.dom.DocumentImpl.cloneOrImportNode(DocumentImpl.java:208)
  02-06 14:27:53.328: W/System.err(9082):     at org.apache.harmony.xml.dom.DocumentImpl.importNode(DocumentImpl.java:222)
  02-06 14:27:53.328: W/System.err(9082):     at com.xxxx.xxxx.XMLSelection.extract(XMLSelection.java:57)
  </code></pre>