title: Loading Xml file from Isolated Storage - Windows Phone 7
body: <p>I'm trying to load xml data saved in the isolated storage, but I always get an error.
  I use the following code to load xml data saved in the isolated storage</p>
  
  <pre><code> IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication();
  
          storage.CreateDirectory("Highscores");
  
          using (var isoFileStream = new IsolatedStorageFileStream("Highscores\\scores.xml", FileMode.OpenOrCreate, storage))
          {
              using (XmlReader reader = XmlReader.Create(isoFileStream))
              {
                  XDocument xml = XDocument.Load(reader);
                  int i = 0;
  
                  foreach (var score in xml.Root.Element("Highscores").Elements())
                  {
                      Count_to_10.Page2.Highscores.scores[i++] = score.Value.ToString();
                  }
  
              }
          }
  </code></pre>
  
  <p>But I get the following error</p>
  
  <pre><code>Root element is missing.
  </code></pre>
  
  <p>in this line</p>
  
  <pre><code>XDocument xml = XDocument.Load(reader);
  </code></pre>
  
  <p>The xml file is:</p>
  
  <pre><code>&lt;HighscoreTable&gt;
    &lt;Highscores length="25"&gt;
      &lt;score&gt;00:00:09.000&lt;/score&gt;
      &lt;score&gt;00:00:07.000&lt;/score&gt;
      &lt;score&gt;00:00:02.000&lt;/score&gt;
      &lt;score&gt;00:00:04.000&lt;/score&gt;
    &lt;/Highscores&gt; 
  &lt;/HighscoreTable&gt;
  </code></pre>
  
  <p>I'd be glad if you'd help me find the source of the error.</p>