String root = \"RdbTunnels\"; DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = documentBuilder
Have you seen OutputKeys as used by Transformer? Specifically OMIT_XML_DECLARATION.
OutputKeys
Transformer
OMIT_XML_DECLARATION
Note that removing the header is valid in XML 1.0, but you lose character encoding data (among other things) which can be very important.