XmlDocument doc = new XmlDocument(); doc.LoadXml("In this example, we load an XML document into an XmlDocument object and select all nodes with the name "item". We then retrieve the second node (index 1) using the Item property and output its inner text. The System.Xml namespace provides the XmlNodeList class used in this example."); XmlNodeList itemList = doc.SelectNodes("//item"); XmlNode item2 = itemList.Item(1); Console.WriteLine(item2.InnerText); // Output: 2 - 1
- 2
- 3