title: XmlDocument GetElementsByTagName within a specified block in C#
body: <p>I have an xml file and currently I am getting element-by-tag-name.  What I am trying to achieve is to specify which block to use, such as bookstore or shop.  Thank you for any help and advice.   </p>
  
  <p>XML:</p>
  
  <pre><code>&lt;VariablesSpecs name="Data01"&gt;
    &lt;bookstore&gt;
      &lt;book genre='novel' ISBN='10-861003-324'&gt;
        &lt;title&gt;The Handmaid's Tale&lt;/title&gt;
        &lt;price&gt;19.95&lt;/price&gt;
      &lt;/book&gt;
    &lt;/bookstore&gt;
    &lt;shop&gt;
      &lt;book genre='novel' ISBN='10-861003-324'&gt;
        &lt;title&gt;The Handmaid's Tale&lt;/title&gt;
        &lt;price&gt;19.95&lt;/price&gt;
      &lt;/book&gt;
    &lt;/shop&gt;
  &lt;/VariablesSpecs&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>var doc = new XmlDocument();
  doc.Load("data.xml");
  
  var bookNodes = doc.GetElementsByTagName("book");
  foreach (var bookNode in bookNodes)
  {
      // Collect data.
  }
  </code></pre>