我有这段代码:
public void generateXML(DynamicForm form) {
Document doc = XMLParser.createDocument();
Element root = doc.createElement("root");
doc.appendChild(root);
Element node1 = doc.createElement("node1");
node1.setAttribute("attribute","test");
node1.appendChild(doc.createTextNode("my value"));
doc.appendChild(node1);
Element node2 = doc.createElement("node2");
node2.setAttribute("attribute","anothertest");
doc.appendChild(node2);
System.out.println(doc.toString());
}
如何将此文档发送到客户端进行下载而不将其存储在目录中?