title: Windows phone 8.1 XDocument xml serialization C#
body: <p>I'm creating a Windows Phone 8.1 app, and I need to serialize my data to XML. </p>
  
  <p>I have two functions; the first one is creating a document where I can later put my retrieved data.</p>
  
  <pre><code>public async Task make()
      {
          using (var questions = await ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync(
                  "data.xml",
                  CreationCollisionOption.OpenIfExists))
          {
              XDocument xml = new XDocument(
                  new XDeclaration("1.0", "utf-8", "yes"),
                      new XElement("Root")
                  );  
              xml.Save(questions);
          }
      }
  </code></pre>
  
  <p>The second one is making serialization to my xml file:</p>
  
  <pre><code>public async Task serial(Tsk tak)
      {
              using (var questions = await ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync(
                  "data.xml",
                  CreationCollisionOption.OpenIfExists))
              {   
                  XDocument xml = XDocument.Load(questions);
                   xml.Root.Add(new XAttribute("Date", tak.Date),
                   new XElement("time", tak.Time),
                   new XElement("text", tak.Text)
                   );
                  xml.Save(questions);
  
  
              }
      }
  </code></pre>
  
  <p>The first xml function is making this code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
  &lt;root /&gt;
  </code></pre>
  
  <p>When I'm running the second function I've got this error: <code>root element is missing</code>.  Can anyone tell me how I can get this serialization to work? </p>