title: XML and C# Load Attributes of in specified nodes
body: <p>So basically I have this XML Doc</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;items&gt;
    &lt;food&gt;
      &lt;item ItemName="Hamburger" Cost="1.50" Image="hamburger.jpg" /&gt;
      &lt;item ItemName="Hamburger" Cost="1.50" Image="hamburger.jpg" /&gt;
      &lt;item ItemName="Hamburger" Cost="1.50" Image="hamburger.jpg" /&gt;
      &lt;item ItemName="Hamburger" Cost="1.50" Image="hamburger.jpg" /&gt;
    &lt;/food&gt;
    &lt;snaks&gt;
  
    &lt;/snaks&gt;
    &lt;drinks&gt;
      &lt;item ItemName="Hamburger" Cost="1.50" Image="hamburger.jpg" /&gt;
      &lt;item ItemName="Hamburger" Cost="1.50" Image="hamburger.jpg" /&gt;
      &lt;item ItemName="Hamburger" Cost="1.50" Image="hamburger.jpg" /&gt;
    &lt;/drinks&gt;
    &lt;vitamins&gt;
  
    &lt;/vitamins&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>I want to be able to load the Attributes of <code>&lt;item&gt;</code> in <code>&lt;items&gt;&lt;food&gt;</code> and do something with with each <code>&lt;item&gt;</code>. I tried something like this (<a href="http://www.java2s.com/Tutorial/CSharp/0540__XML/SelectnodesfromXmlDocument.htm" rel="nofollow">This</a>) but it only worked for the first <code>&lt;item&gt;</code> not the other 3.</p>