title: extract values from xml tags with identical names in C#
body: <p>I have a C# .NET app that contains a dynamically generated xml document. It tracks order info, such as name, date the order was placed, all that sort of stuff. I have no issue extracting the information contained in these tags using innerText.</p>
  
  <p>However, when the order is 'built' by our customer, they are allowed to attach files....</p>
  
  <p>Each file is saved in the xml doc under the tag </p>
  
  <p>So I end up with something (simplified) like this:</p>
  
  <pre><code>&lt;order&gt;
     &lt;Number&gt;1&lt;/Number&gt;
     &lt;Email&gt;example@stack.com&lt;/Email&gt;
     &lt;Date&gt;2012-08-13&lt;/Date&gt;
     &lt;File&gt;File1.txt&lt;/File&gt;
     &lt;File&gt;File2.txt&lt;/File&gt;
  &lt;/order&gt;
  </code></pre>
  
  <p>As I said, I extract the other info using</p>
  
  <pre><code>   foreach (XmlElement element in file.SelectNodes("/order"))
     {
         String strNumber = element.SelectSingleNode("Number").InnerText,
                 strEmail = element.SelectSingleNode("Email").InnerText,
                  strDate = element.SelectSingleNode("Date").InnerText;
     } 
  </code></pre>
  
  <p>However when I do this with name, I get an error honking about not being set to an instance... Which I totally understand.</p>
  
  <p>My question is, how can I get this info? There can be any number of Files attached, from zero to however many the user wants.</p>
  
  <p>Thank you for your time.</p>