using System.Xml; //load the document XmlDocument doc = new XmlDocument(); doc.LoadXml("In this example, the XmlDocument class is used to load an XML document and create a navigator for the document. The MoveToParent method is then used to move to the parent node of the current node (node2). Finally, the Name property of the navigator is used to output the name of the current node (node1). The package/library being used in this example is the System.Xml assembly, which is included in the .NET Framework Class Library."); //create a navigator for the document XmlNodeNavigator navigator = doc.CreateNavigator(); //move to the node2 element and output its value navigator.MoveToFirstChild(); //node1 navigator.MoveToFirstChild(); //node2 Console.WriteLine(navigator.Value); //output: value2 //move to the parent node (node1) navigator.MoveToParent(); Console.WriteLine(navigator.Name); //output: node1 value2