string strxml = " ";
strxml + =" ";
strxml + = " C # premier ";
strxml + = " 2005 ";
strxml + = " Qinghua University Press ";
strxml + = " Hou ";
strxml + = " 500 ";
strxml + = " C # fundation knowledge ";
strxml + = " 50.00 ";
strxml + = " ";
strxml + = " ";
strxml + = " XML premier ";
strxml + = " 2005 ";
strxml + = " peking university press ";
strxml + = " Leo ";
strxml + = " 400 ";
strxml + = " XML fundation knowledge ";
strxml + = " 45.00 ";
strxml + = " ";
strxml + = " ";
strxml + = " UML ";
strxml + = " 2005 ";
strxml + = " peking university press ";
strxml + = " James ";
strxml + = " 650 ";
strxml + = " UML fundation knowledge ";
strxml + = " 85.00 ";
strxml + = " ";
Response. contenttype = "text/XML ";
Response. charset = "UTF-8 ";
System. xml. xmldocument Doc = new system. xml. xmldocument ();
Doc. loadxml (strxml );
Doc. Save (response. outputstream );
Response. End ();
Read existing XML:
Response. contenttype = "text/XML ";
Response. charset = "UTF-8 ";
System. xml. xmldocument Doc = new system. xml. xmldocument ();
String strpath = @"~ /Login/xmlfile ";
Doc. Load (server. mappath (strpath + "/books. xml"); // requests. XML is the XML file on the server.
Response. Write (Doc. documentelement. outerxml );
Response. End ();
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/wsdgqs/archive/2008/03/31/2233662.aspx