title: how to get the value of next node in xml using C#
body: <p>Here is the xml code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xd:xmldiff version="1.0" srcDocHash="11928043053884448382" options="IgnoreChildOrder IgnoreNamespaces IgnoreWhitespace IgnoreXmlDecl " fragments="no" xmlns:xd="http://schemas.microsoft.com/xmltools/2002/xmldiff"&gt;
      &lt;xd:node match="2"&gt;
          &lt;xd:node match="2"&gt;
              &lt;xd:node match="19"&gt;
                  &lt;xd:node match="2"&gt;
                      &lt;xd:add&gt;Y&lt;/xd:add&gt;
                  &lt;/xd:node&gt;
              &lt;/xd:node&gt;
              &lt;xd:add match="/2/2/11" opid="2" /&gt;
              &lt;xd:change match="18" name="OWNINGSITE"&gt;
                  &lt;xd:node match="2"&gt;
                      &lt;xd:remove match="1" /&gt;
                  &lt;/xd:node&gt;
              &lt;/xd:change&gt;
              &lt;xd:add match="/2/2/2-9" opid="1" /&gt;
              &lt;xd:change match="17" name="STATUS"&gt;
                  &lt;xd:node match="2"&gt;
                      &lt;xd:remove match="1" /&gt;
                  &lt;/xd:node&gt;
              &lt;/xd:change&gt;
              &lt;xd:remove match="14-16" /&gt;
              &lt;xd:remove match="13" subtree="no"&gt;
                  &lt;xd:remove match="1-2" /&gt;
              &lt;/xd:remove&gt;
              &lt;xd:remove match="11" opid="2" /&gt;
              &lt;xd:remove match="10" /&gt;
              &lt;xd:remove match="2-9" opid="1" /&gt;
              &lt;xd:remove match="1" /&gt;
          &lt;/xd:node&gt;
          &lt;xd:node match="5"&gt;
              &lt;xd:node match="3"&gt;
                  &lt;xd:node match="11"&gt;
                      &lt;xd:change match="1"&gt;0,1,0,1,0,0,0,0,1&lt;/xd:change&gt;
                  &lt;/xd:node&gt;
              &lt;/xd:node&gt;
          &lt;/xd:node&gt;
      &lt;/xd:node&gt;
      &lt;xd:descriptor opid="1" type="move" /&gt;
      &lt;xd:descriptor opid="2" type="move" /&gt;
  &lt;/xd:xmldiff&gt;
  </code></pre>
  
  <p>I have written the c# code snippet to get the value of "match". I am able to get the value of first match i.e. "2" but am unable to go to the next node and get the value of its "match".
  My output should be:</p>
  
  <p>first match value 2</p>
  
  <p>second match value 2</p>
  
  <p>third match value 19 </p>
  
  <pre><code>    namespace demo
      {
          class Program
          {
              static void Main()
              {
  
                  XmlDocument xmlDoc = new XmlDocument();
                  xmlDoc.Load(@"C:\\shreyas\\NX_Temp\\NX_Temp\\000048_A\\CompareReport3D.xml");
                 // XmlNodeList nodeList1= xmlDoc.ReadNode();
  
                  XmlNodeList nodeList = xmlDoc.DocumentElement.SelectNodes("*");
                 string[] arr1 = new string[10];
                  int i = 0;
                 foreach (XmlNode node1 in nodeList)
                 {
                     XmlNode personalNode = node1.SelectSingleNode("/node");
                     arr1[i] = node1.Attributes["match"].Value;
                     Console.WriteLine("first match value:" +arr1[i]);
                     i++;
  //upto this point am getting the output and the exception after this
                     arr1[i] = personalNode.Attributes["match"].Value;
                     Console.WriteLine("second match value:" + arr1[i]);
                     i++;
                     arr1[i] = personalNode.Attributes["match"].Value;
                     Console.WriteLine("third match value:" + arr1[i]);
  
                 }
  
              }
          }  
      }
  </code></pre>