how to return entire xml as string
843834Apr 21 2008 — edited May 10 2008hi
i have created a xml using DOM
DocumentBuilderFactory fctry=DocumentBuilderFactory.newInstance();
DocumentBuilder bldr=fctry.newDocumentBuilder();
Document doc = bldr.newDocument();
doc.setXmlVersion("1.0");
//XmlDeclaration xd = doc.CreateXmlDeclaration("1.0", "utf-8", null);
//doc.a AppendChild(xd);
Element el = doc.createElement("Messages");
Node root = doc.appendChild(el);
for (String msg :messages)
{
Node node = doc.createElement("msg");
node.setTextContent(msg);
root.appendChild(node);
}
now i want to return entire xml as a string , with all the tag name
so how can i return?
Regards
praveen