title: getting stackoverflowerror while converting org.w3c.dom.Document to org.dom4j.Document
body: <p>I am getting stackoverflowerror while conveting org.w3c.dom.Document to org.dom4j.Document</p>
  
  <p>Code :</p>
  
  <pre><code>public static org.dom4j.Document getDom4jDocument(Document w3cDocument)
      {
          //System.out.println("XMLUtility : Inside getDom4jDocument()");
          org.dom4j.Document dom4jDocument  = null;
          DOMReader xmlReader  = null;
          try{
              //System.out.println("Before conversion of w3cdoc to dom4jdoc");
              xmlReader = new DOMReader();            
              dom4jDocument = xmlReader.read(w3cDocument);
              //System.out.println("Conversion complete");
          }catch(Exception e){
              System.out.println("General Exception :- "+e.getMessage());
          }
          //System.out.println("XMLUtility : getDom4jDocument() Finished");
          return dom4jDocument;   
      } 
  </code></pre>
  
  <p>log :</p>
  
  <pre><code>java.lang.StackOverflowError
      at java.lang.String.indexOf(String.java:1564)
      at java.lang.String.indexOf(String.java:1546)
      at org.dom4j.tree.NamespaceStack.getQName(NamespaceStack.java:158)
      at org.dom4j.io.DOMReader.readElement(DOMReader.java:184)
      at org.dom4j.io.DOMReader.readTree(DOMReader.java:93)
      at org.dom4j.io.DOMReader.readElement(DOMReader.java:226)
      at org.dom4j.io.DOMReader.readTree(DOMReader.java:93)
      at org.dom4j.io.DOMReader.readElement(DOMReader.java:226)
  </code></pre>
  
  <p>Actually i want to convert XML to string by using org.dom4j.Document's asXML method. Is this conversion possible without converting org.w3c.dom.Document to org.dom4j.Document ? How ? </p>