title: how to convert org.w3c.dom.Document to org.jdom.Document
body: <p>I need to convert a <code>org.w3c.dom.Document</code> to  <code>org.jdom.Document</code></p>
  
  <p>I have tried the following following..</p>
  
  <pre><code>InputStream inputStream =  new ByteArrayInputStream(str.getBytes());
  
  Tidy tidy = new Tidy();
  tidy.setMakeClean(false);
  tidy.setShowWarnings(true); //tidy.setShowWarnings(false);
  tidy.setTidyMark(false);
  tidy.setNumEntities(true);
  tidy.setQuoteAmpersand(true);
  tidy.setQuoteMarks(true);
  tidy.setQuoteNbsp(false);
  tidy.setHideEndTags(false);
  tidy.setDropEmptyParas(false);
  
  Document tidyDOM =tidy.parseDOM(inputStream, null);
  DOMBuilder domBuilder = new DOMBuilder();
  org.jdom.Document jdomDoc = domBuilder.build(tidyDOM);
  </code></pre>
  
  <p><code>domBuilder.build(tidyDOM)</code> throws the following exception:</p>
  
  <pre><code>org.jdom.IllegalNameException: The name "html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"" is not legal for JDOM/XML DocTypes: XML names cannot contain the character " ".
      at org.jdom.DocType.setElementName(DocType.java:171)
      at org.jdom.DocType.&lt;init&gt;(DocType.java:111)
      at org.jdom.DocType.&lt;init&gt;(DocType.java:144)
      at org.jdom.DefaultJDOMFactory.docType(DefaultJDOMFactory.java:118)
      at org.jdom.input.DOMBuilder.buildTree(DOMBuilder.java:332)
      at org.jdom.input.DOMBuilder.buildTree(DOMBuilder.java:170)
      at org.jdom.input.DOMBuilder.build(DOMBuilder.java:135)
      at test.JaxenTest.testParsingVisitor(JaxenTest.java:58)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  </code></pre>