My home project code is like the following:
DOMSource domSource = new DOMSource(xml); //xml is a DOM tree.
File F = new File ("customerlist.xml");
TransformerFactory tff = TransformerFactory.newInstance();
Transformer serializer = new tff.newTransformer();
StreamResult srOut = new StreamResult(tff);
serializer.transform(domSource, srOut);
So I am using DOM and then serialize it to XML. So the servlet will
call this code to generate 'customerlist.xml' on the fly. So how to
connect 'response' object with srOut and then display
'customerlist.xml' out to the client without writing it to a File?