title: What Java XML library do you recommend (to replace dom4j)?
body: <p>I'm looking for something like dom4j, but without dom4j's warts, such as bad or missing documentation and seemingly stalled development status.</p>
  
  <p>Background: I've been using <a href="https://stackoverflow.com/questions/807418/simplest-way-to-query-xml-in-java/831595#831595">and</a> <a href="https://stackoverflow.com/questions/729621/convert-string-xml-fragment-to-document-node-in-java/729979#729979">advocating</a> dom4j, but don't feel completely right about it because I know the library is far from optimal (example: see how methods in XSLT related <a href="http://www.dom4j.org/dom4j-1.6.1/apidocs/org/dom4j/rule/Stylesheet.html" rel="nofollow noreferrer">Stylesheet</a> class are documented; what would you pass to run() as the <code>String mode</code> parameter?)</p>
  
  <p>Requirements:
  The library should make basic XML handling easier than it is when <a href="https://stackoverflow.com/questions/729621/convert-string-xml-fragment-to-document-node-in-java/729668#729668">using</a> <a href="https://stackoverflow.com/questions/807418/simplest-way-to-query-xml-in-java/807508#807508">pure JDK</a> (<a href="http://java.sun.com/javase/6/docs/api/index.html?javax/xml/package-summary.html" rel="nofollow noreferrer"><code>javax.xml</code></a> and <a href="http://java.sun.com/javase/6/docs/api/index.html?org/w3c/dom/package-summary.html" rel="nofollow noreferrer"><code>org.w3c.dom</code></a> packages). Things like this:</p>
  
  <ul>
  <li>Read an XML document (from file or String) into an object, easily traverse and manipulate the DOM, do XPath queries and run XSLT against it.  </li>
  <li>Build an XML document in your Java code, add elements and attributes and data, and finally write the document into a file or String.</li>
  </ul>
  
  <p>I really like what <a href="http://www.dom4j.org/" rel="nofollow noreferrer">dom4j promises</a>, actually: "<em>easy to use, open source library for working with XML, XPath and XSLT [...] with full support for DOM, SAX and JAXP.</em>" And upcoming dom4j 2.0 does claim to fix everything: fully utilise Java 5 and add missing documentation. But unfortunately, if you <a href="http://www.dom4j.org/download.html" rel="nofollow noreferrer">look closer</a>:</p>
  
  <blockquote>
    <p>Warning: dom4j 2.0 is in pre-alpha
    stage. It is likely it can't be
    compiled. In case it can be compiled
    at random it is likely it can't run.
    In case it runs occasionally it can
    explode suddenly. If you want to use
    dom4j, you want version 1.6.1. Really.</p>
  </blockquote>
  
  <p>...and the website has said that for a <em>long</em> time. So is there a good alternative to dom4j? Please provide some justification for your preferred library, instead of just dumping names and links. :-)</p>