I am trying to output a DOM that contains elements such as to an html file, but it will show   in the output, which is obviously not desirable. My code is as follows
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.METHOD, "html");
Result result = new StreamResult(output);
transformer.transform(new DOMSource(document), result);
is there anyway to get it to just output the (and no, replacing in the input is not an option )?