title: System.Xml.XmlException: Unexpected XML declaration. The XML declaration must be the first
body: <p>I got this error while Parse an string to XDocument after edit and save it. But anyone can help me locate error position - The Line 1, position 10475. How can i get that position ??? </p>
  
  <blockquote>
    <p>System.Xml.XmlException: Unexpected XML declaration. The XML
    declaration must be the first node in the document, and no white space
    characters are allowed to appear before it. Line 1, position 10475.</p>
  </blockquote>
  
  <pre><code>if (storage.FileExists("APPSDATA.xml"))
  {
    var reader = new StreamReader(new IsolatedStorageFileStream("APPSDATA.xml", FileMode.Open, storage));
  
    string xml = reader.ReadToEnd();
    var xdoc = XDocument.Parse(xml);//error here 
    reader.Close(); 
  </code></pre>
  
  <p>The XML is big, this is jus a part of it </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Ungdungs&gt;
    &lt;Ungdung&gt;
      &lt;Name&gt;HERE City Lens&lt;/Name&gt;
      &lt;Id&gt;b0a0ac22-cf9e-45ba-8120-815450e2fd71&lt;/Id&gt;
      &lt;Path&gt;/Icon/herecitylens.png&lt;/Path&gt;
      &lt;Version&gt;1.0.0.0&lt;/Version&gt;
      &lt;Category&gt;HERE&lt;/Category&gt;
      &lt;Date&gt;Uknown&lt;/Date&gt;
    &lt;/Ungdung&gt;
    &lt;Ungdung&gt;
      &lt;Name&gt;HERE Transit&lt;/Name&gt;
      &lt;Id&gt;adfdad16-b54a-4ec3-b11e-66bd691be4e6&lt;/Id&gt;
      &lt;Path&gt;/Icon/heretransit.png&lt;/Path&gt;
      &lt;Version&gt;1.0.0.0&lt;/Version&gt;
      &lt;Category&gt;HERE&lt;/Category&gt;
      &lt;Date&gt;Uknown&lt;/Date&gt;
    &lt;/Ungdung&gt;
  </code></pre>