title: how to save data in xml using windows 8.1 mobile app
body: <p>when i click save button data is not saving in xml file  </p>
  
  <pre><code>private const string XmlFile = "Order.xml";
  private async void btncalculate_Click(object sender, RoutedEventArgs e)
          {
              ClsOrder ord = new ClsOrder();
              ord.Id = 1;
              ord.package = str;
              ord.Domestic = strchk;
  
              List&lt;ClsOrder&gt; ordlist = await getXmlorderlist();
              ordlist.Add(ord);
  
              using (var stream = await ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync(XmlFile, CreationCollisionOption.ReplaceExisting))
              {
                  var serializer = new DataContractSerializer(typeof(List&lt;ClsOrder&gt;));
                  serializer.WriteObject(stream, ordlist);
              }
  }
  private async Task&lt;List&lt;ClsOrder&gt;&gt; getXmlorderlist()
          {
              await ApplicationData.Current.LocalFolder.CreateFileAsync(XmlFile, CreationCollisionOption.OpenIfExists);
              var stream = await ApplicationData.Current.LocalFolder.OpenStreamForReadAsync(XmlFile);
              if (stream.Length == 0)
                  return new List&lt;ClsOrder&gt;();
              DataContractSerializer serializer = new DataContractSerializer(typeof(List&lt;ClsOrder&gt;));
              List&lt;ClsOrder&gt; ordlist = (List&lt;ClsOrder&gt;)serializer.ReadObject(stream);
              return ordlist;
          }
  </code></pre>
  
  <p>How to save data in xml file.??
  This code is not working..
  I have taken all the data in list <code>List&lt;ClsOrder&gt; ordlist</code>,I want to save data in xml. </p>