This xml blog helps you to read node from xml document.So first you need to import namespace system.Xml. Now create instance for xmldocument.This is the sample xml document through which you are going to read particular node.

              <class>
                    <standard>
                    1
                    <standard>
                    <teacher>
                        Shiva
                    <teacher>
                    <noofstudents>
                          80
                    <noofstudents>
               <class>
                

For example, i want to get teacher name from the above sample xml document.Here is the code to achieve it.

                       using System.Xml;
                       XmlDocument xmldoc=new XmlDocument();
                        string filename= "sample.xml";
                        xmldoc.Load(filename);
                        foreach(xmlnode node in xmldoc.GetElementsByTagName("class"))
                        {
                            foreach(xmlnode node1 in node.ChildNodes)
                            {
                                if(node1.Name="teacher")
                                {
                                    console.writeline("Teacher Name:" + node1.InnerText);
                                
                                }
        
                            }
                        
                         }