title: Getting values from xml file using C#
body: <p>I'm pretty new to xml and I don't know how to read/get values from xml file below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;Jeopardy&gt;
    &lt;category name = 'People in Computing'&gt;
  &lt;first points = '100' answer = 'Alan Turing'&gt;Known as the questioner of the human   mind, this man is known for helping tell humans and computers apart.&lt;/first&gt;
  &lt;second points = '200' answer = 'Grace Hopper'&gt;This female pioneer of the COBOL computer programming language was an Admiral in the US Navy.&lt;/second&gt;
  &lt;third points = '300' answer = 'Tim Berners-Lee'&gt;Called the father of the world wide web, this man is the director of the W3C.&lt;/third&gt;
  &lt;fourth points = '400' answer = 'Lawrence Lessig'&gt;An American academic and political activist who founded the Creative Commons, this man lobbies for reduced legal restrictions on copyrights and trademarks in the technology sector.&lt;/fourth&gt;
  &lt;fifth points = '500' answer = 'Ada Lovelace'&gt;This woman, known as the world's first computer programmer was also a Countess.&lt;/fifth&gt;
    &lt;/category&gt;
  &lt;/Jeopardy&gt;
  </code></pre>
  
  <p>Sorry for the terrible formatting, can't get it right.</p>
  
  <p>First of all, I tried to load this file in XDocument results in a "Non-white space cannot be added to content" exception, but it didn't occur if loaded into XmlDocument.</p>
  
  <p>My code to attempt to get the name value:</p>
  
  <pre><code>        string fileName = @"C:\Users\Kara\documents\visual studio 2010\Projects\Final Project\Final Project\Jeopardy.xml";
  
          XmlDocument doc = new XmlDocument();
  
          doc.Load(fileName);
  
          List&lt;string&gt; categories = new List&lt;string&gt;();
  
          XmlNodeList nList = doc.SelectNodes("/category/name");
  
          foreach (XmlNode node in nList)
          {
              categories.Add(node.ToString());
          }
  </code></pre>
  
  <p>Sadly while debugging the nList has a count of zero and I cannot figure out why.  I've tried looking at a ton of questions already on here and tutorials elsewhere and I'm just getting frustrated.  How in the world do I get the values out of name and other nodes?  Can someone explain this?  And perhaps why I get the non-white space error with XDocument?</p>