Servlet will return whatever you'll program it to return. Normally it would be a HTML, but there is no restriction on that. All you have to do is to change the "Content-Type" header from "text/html" to "text/xml" and then return a formatted XML response. The same goes with all other formats (.zip, .doc, ...)
You might want to look at XSLT for displaying your xml
thank you !
Now i will test using delphi to call the servlet which returns xml data .And the xml data will be populated into a TClientDataSet.
Now i have successfully gotten XML data from servlet according to your suggestion,setting the contentType to text/xml.
However i donot know how to send XML to servlet ? Do i need to base64-encoding the XML data? If yes,please tell me how to do it ? Because i am not very familiar with base64 :(