StringWriter writer = new StringWriter();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.transform(new DOMSource(node), new StreamResult(writer));
out.print("<zhape>"+writer.toString()+"</zhape>");
when i use the code above the the following line also appear in the output.
<?xml version="1.0" encoding="UTF-8"?>
How can i omit this and get just the XML content.
use the OUTPUTKEYS to set the property in the TRANSFORMER. To do what you want you should use the OMIT_XML_DECLARATION output key.