The application is written in UWP. I created an xml file using XmlWriter and wrote the data there. The question is how then, as required, to load the created file into the stream and fill it further, without overwriting the previous records.
StorageFolder logfolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("Order.xml", CreationCollisionOption.OpenIfExists); StorageFile logfile = await logfolder.CreateFileAsync("Order.xml", CreationCollisionOption.OpenIfExists); using(IRandomAccessStream writestream = await logfile.OpenAsync(FileAccessMode.ReadWrite)) { Stream stream = writestream.AsStreamForWrite(); XmlWriterSettings settings = new XmlWriterSettings(); using(XmlWriter writer = XmlWriter.Create(stream, settings)) { writer.WriteStartElement("Orders"); writer.WriteElementString("Order","First Order"); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); }