title: Load selective XML data into Dataset using C#
body: <p>Appreciate some pointers on how can I use XPath on XML file to extract only some data and load it into a dataset. </p>
  
  <pre><code>ds.ReadXml(fsReadXml);
  </code></pre>
  
  <p>will load the entire xml into dataset but my requirement is to load only particular node and values to dataset.</p>
  
  <p>Sample xml data:</p>
  
  <pre><code>&lt;data cobdate="5 Jul 2011" DBStatus=""&gt;
    &lt;view&gt;BOTH&lt;/view&gt;
    &lt;show_acctnbr&gt;true&lt;/show_acctnbr&gt;
    &lt;summary&gt;
      &lt;headings sum="Summary" real_per="Realized this period" real_trd="Profit/loss in trading currency" real_select="Profit/loss in selected currency" short_term="Short Term Profit/Loss" long_term="Long Term Profit/Loss" /&gt;
      &lt;account number="A123456" curr_code="USD" curr_desc="US Dollars" tradecurrvalue="123,123.00" selectcurrvalue="123,123.00" managed="NO" /&gt;
      &lt;account number="P123456" curr_code="USD" curr_desc="US Dollars" tradecurrvalue="0.00" selectcurrvalue="0.00" managed="NO" /&gt;
    &lt;/summary&gt;
    &lt;detail&gt;
      &lt;headings dateaq="Date acquired" datesld="Date sold" desc="Description" sec_nbr="Security number " qty="Quantity" cost="Cost basis" /&gt;
      &lt;account number="A123456" currency="US Dollars"&gt;
        &lt;item datesold="29 Apr 11" sec_nbr="1234" description="SOME VALUE(USD)" quantity="8,000" proceeds="123,123.0" /&gt;
        &lt;item datesold="29 Apr 11" sec_nbr="4567" description="SOME VALUE(USD)" quantity="9,000" proceeds="123,123.0" /&gt;
      &lt;/account&gt;
      &lt;account number="P123456" currency="US Dollars"&gt;
        &lt;item datesold="29 Apr 11" sec_nbr="1234" description="SOME VALUE(USD)" quantity="8,000" proceeds="123,123.0" /&gt;
        &lt;item datesold="29 Apr 11" sec_nbr="4567" description="SOME VALUE(USD)" quantity="9,000" proceeds="123,123.00" /&gt;
      &lt;/account&gt;
    &lt;/detail&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p>In this example data, I just need to load accounts from <code>&lt;summary&gt;</code> node and if possible only number, tradecurrvalue and selectcurrvalue attributes. I using C# and 3.5. </p>