title: Reading attribute values with XmlReader
body: <p>I have an XML file that I'm trying to read from <a href="http://www.newyorkfed.org/markets/seclend/xml/v3_0/secLendingXML.cfm" rel="noreferrer">here</a>, and have the following code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Xml;
  using System.IO;
  
  namespace XML
  {
      class Program
      {
          static void Main(string[] args)
          {
              XmlTextReader textReader = new XmlTextReader("secLendingXML.cfm.xml");
              while (textReader.Read())
              {
                  switch (textReader.NodeType)
                  {
                      case XmlNodeType.Element:
                          Console.WriteLine(textReader.Name);
                          Console.WriteLine(textReader.Value);
                          break;
                      case XmlNodeType.Text:
                          Console.WriteLine(textReader.Value);
                          break;
                      case XmlNodeType.XmlDeclaration:
                      case XmlNodeType.ProcessingInstruction:
                          Console.WriteLine(textReader.Name + " " + textReader.Value);
                          break;
                      case XmlNodeType.Comment:
                          Console.WriteLine(textReader.Value);
                          break;
                      case XmlNodeType.EndElement:
                          break;
                  }
              }
              Console.ReadLine();
          }
      }
  }
  </code></pre>
  
  <p>The code is working properly in the sense that it's reading the nodes and returning the names.  But, the issue is that I'm trying to also retrieve the data within the nodes.  In other words, when it reads the first section after the test section, it will read:</p>
  
  <pre><code>slnc:DataSet
  slnc:Group
  slnc:Section
  slnc:ActualAvailableToBorrow
  *** here ***
  slnc:oustandingLoans
  </code></pre>
  
  <p>This is where I want the textreader to read the following values within the node like
  <code>confidentiality="F"</code>, <code>currency="USD"</code>, etc., but it just skips right to the 
  next section without reading these values!</p>
  
  <pre><code>&lt;slnc:actualAvailableToBorrow xmlns:slnc="http://www.newyorkfed.org/xml/schemas/SecLending" 
        confidentiality="F" currency="USD" decimals="0" method="AA" 
        multiplier="5" securityLendingType="AA" status="A" value="1474"/&gt;
  </code></pre>
  
  <p>How do I get the textreader to read the attribute values?  It would be ideal for it to print the value "currency", and then its value: "F", and so on.</p>