title: Any java XML tree libraries where all value types are immutable
body: <p>Im just wondering if there are any good complete ones out there. By immutable i mean ones that are always immutable. If the library includes freeze() or equivalent methods to make some value instance immutable then plz make note of this in your reply. I am mostly intersted in libraries that return new copies when a change is made to said node.</p>
  
  <p>To start off with i am going to list a few common libraries which are NOT immutable. </p>
  
  <p><a href="http://xerces.apache.org/xerces-j/apiDocs/org/w3c/dom/Element.html" rel="nofollow">http://xerces.apache.org/xerces-j/apiDocs/org/w3c/dom/Element.html</a></p>
  
  <blockquote>
    <p>removeAttributeNS(java.lang.String namespaceURI, java.lang.String
    localName) 
              Removes an attribute by local name and namespace URI.  void setAttribute(java.lang.String name, java.lang.String value) 
              Adds a new attribute.</p>
  </blockquote>
  
  <p><a href="http://www.jdom.org/docs/apidocs/org/jdom2/Comment.html" rel="nofollow">http://www.jdom.org/docs/apidocs/org/jdom2/Comment.html</a></p>
  
  <blockquote>
    <p>Comment  setText(java.lang.String text) 
              This will set the value of the Comment.</p>
  </blockquote>
  
  <p><em>Note</em> all important classes include setters.</p>
  
  <p><a href="http://www.xom.nu/apidocs/index.html?nu/xom/Attribute.html" rel="nofollow">http://www.xom.nu/apidocs/index.html?nu/xom/Attribute.html</a></p>
  
  <blockquote>
    <p>setType(Attribute.Type type) </p>
  
  <pre><code>       Sets the type of this attribute to one of the ten DTD types or Type.UNDECLARED.  void  setValue(String value) 
  
         Sets the attribute's value to the specified string, replacing any previous value.
  </code></pre>
  </blockquote>
  
  <p>If you have any comments about immutability killing performance, then free to make them but provide some real tasty info rather than a boring opinion.</p>