An XML document can't consist of only text. It has to have a root element. That's why it's "not working", as you put it. Now if you went to the root element of the document and tried to set its content to some text, that probably wouldn't throw any exceptions.
Joined: Aug 30, 2005
So then is there any simple way in the java document api way to go from raw text (a String) to a Document object without a file name ?