1. ALWAYS use the "code" button to enclose code so humans can read it.
2. The toString() value of a org.w3c.dom.Document is always null. Before doing any more xml programming, carefully study the table in the JavaDocs for org.w3c.dom.Node interface. This shows what each type of DOM Node will return for name and value.