I am creating a com.w3c.dom.Document from a String using this code:
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.parse(new InputSource(new StringReader("<a><b id="5"/></a>")));
When I System.out.println(xmlToString(document)), I get this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><a><b id="5"/></a>
Everything is ok, but I don't want the XML to have the <?xml version="1.0" encoding="UTF-8" standalone="no"?> declaration, because I have to sign the with private key and embed to soap envelope.