title: How to read a particular node from xml in C#?
body: <p>I have following XML:</p>
  
  <pre><code>&lt;Loop Name="MasterData"&gt;
    &lt;Loop Name="SlaveData"&gt;
      &lt;Segment Name="AAA"&gt;
        &lt;Node1&gt;hello&lt;/Node1&gt;
        &lt;Node2&gt;john&lt;/Node2&gt;
        &lt;Node3&gt;hi&lt;/Node3&gt;
        &lt;Node4&gt;marry&lt;/Node4&gt;
      &lt;/Segment&gt;
      &lt;Segment Name="BBB"&gt;
        &lt;Node1&gt;00&lt;/Node1&gt;
        &lt;Node2&gt; &lt;/Node2&gt;
        &lt;Node3&gt;00&lt;/Node3&gt;
        &lt;Node4&gt; &lt;/Node4&gt;
      &lt;/Segment&gt; 
     &lt;/Loop&gt;
  &lt;/Loop&gt;
  </code></pre>
  
  <p>I have to read value of each Node i.e, Node1, Node2, Node3, Node4 which are under Segment node whose attribute ie <code>Name = "AAA"</code>. How can I do this. I am referring following link from stackoverflow but thats not working for me.</p>
  
  <p><a href="https://stackoverflow.com/questions/1600065/how-to-read-attribute-value-from-xmlnode-in-c">How to read attribute value from XmlNode in C#?</a></p>
  
  <p>I need output like this</p>
  
  <p>Lets I have four sting variables <code>strNode1, strNode2, strNode3, strNode4</code>. I want to store values in above four variables like following</p>
  
  <pre><code>strNode1 = "hello"
  strNode2 = "john"
  strNode3 = "hi"
  strNode4  = "marry"
  </code></pre>