title: How to show value of attributes of child nodes of an element in C#?
body: <p>How should I show the value contained in the attributes of child nodes of the element?
  Please consider below example:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;Segments&gt;
          &lt;Segment ID="AAA"&gt;
              &lt;Elements&gt;
  
                  &lt;Element ID ="11" /&gt;
  
                  &lt;Element ID ="22" El/&gt;
  
                  &lt;Element ID ="33" /&gt;
              &lt;/Elements&gt;
           &lt;/Segment&gt;
      &lt;/Segments&gt;    
  </code></pre>
  
  <p>C# code</p>
  
  <pre><code>XmlDocument xmlDocument = new XmlDocument();
  xmlDocument.Load(MyXMLFileLocation);
  
  XmlNodeList xnList = xmlDocument.SelectNodes(/Segments/Segment[@ID='AAA']/Elements);
  foreach (XmlNode xn in xnList)
  {
      if (xn.HasChildNodes)
      {
          foreach (XmlNode childNode in xn.ChildNodes)
          {
  
              // How should I fetch the attributes of childnodes here. I have to show the value contained in ID attributes
           }
      }  
  }
  </code></pre>