String Xmlfilepath = "D:\\log_xml\\marinfo.xml"; Server.MapPath (@ "relative path such as/xml/test.xml"); XmlDocument doc = new XmlDocument (); Doc. Load (xmlfilepath);//load XML file String rst = ""; Use an XPath expression to select all student child nodes in the document XmlNodeList Studentnodelist = doc. SelectNodes ("Root/marketlist/market"); if (studentnodelist! = null) {foreach (XmlNode studentnode in studentnodelist) { The attribute named name is obtained by Attributes string name = studentnode.attributes["Marketname"]. Value+ ":"; rst+= name;//selectSingleNode method obtains the Submarketlist child node under the current node XmlNode Coursesnode = Studentnode.selectsingle Node ("Submarketlist");//Get all the first-level child nodes of Coursenode through the ChildNodes property XmlNodeList coursenodelist = Coursesnode.chil Dnodes; if (coursenodelist! = null) {foreach (XmlNode coursenode in coursenodelist) {rst + = coursenode.attributes["Name"]. Value+ ",";} RST + = "<br/>"; }}} response.write (RST);