I'm curious how people are dealing with the differences in DOM implementations.  I started out with OpenXML, then switched to Xerces, now I'm trying to support JAXP as well.  JAXP is Sun's DOM implementation.
 
For instance, in JAXP, here's their example of how to create an element and add it to a document:
 
 Document doc = db.newDocument ();
 Element root = doc.createElement ("root");
 Attr  tmp;
 Writer  out = new OutputStreamWriter (System.out);
 
 doc.appendChild (root);
In Xerces, this produces an exception.  The last line must be changed to:
 
doc.getDocumentElement().appendChild(root);
 
If the same change is applied to JAXP, getDocumentElement() returns a null, since the document is empty.
 
This is a bit troubling.  I had hoped to support different implementations of the DOM.