title: Problems Editing XML in IsolatedStorage
body: <p>Working on a program that edits XML using isolated storage (MUST always be in Isolated storage). However, i'm recieving an exeption when I run my code:</p>
  
  <p>A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll</p>
  
  <p>Edit 1: Also recieving: An exception of type 'System.Xml.XmlException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary (Occasionally)</p>
  
  <p>Here's the code:</p>
  
  <pre><code>    var storage = IsolatedStorageFile.GetUserStoreForApplication();
      using (Stream stream = storage.OpenFile("voicecmd.xml", FileMode.Truncate, FileAccess.ReadWrite, FileShare.ReadWrite))
      {
          XDocument str1 = XDocument.Load(stream);
          var ns = XNamespace.Get("http://schemas.microsoft.com/voicecommands/1.0");
          str1.Root.Element(ns + "CommandSet").Element(ns + "CommandPrefix").Value = texb.Text;
          str1.Save(stream, SaveOptions.None);
          await VoiceCommandService.InstallCommandSetsFromFileAsync(new Uri("ms-appdata:///local/voicecmd.xml"));
  </code></pre>