As you know, the proper way to create a Dom Element in Java is to do something like this.
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Document d;
Element e;
e = d.createElement("tag");
You need to use d to generate the element because it needs a document context. (I'm not 100% sure why, but maybe misunderstanding this is part of my problem)
What I don't understand is, why you can't do something like this
Element e;
Element e2;
e2 = e.createElement("anothertag");
Since e already has the context of d, why can't I create another element from an element? It would certainly simplify my design not having to keep a reference to the Document everywhere.