title: XmlDocument.Save not updating xml file properties
body: <p>I need help figuring out how <strong>doc.save</strong> works.</p>
  
  <p>Background: got a c# method that gets properties from an xml document. I then sent these as the dataset for a DataGridView in windows form. Im trying to make it so that when the user edits the form the xml values get updated.</p>
  
  <p>First I parse the XML: Updater.cs</p>
  
  <pre><code>XmlNodeList elemList = doc.GetElementsByTagName("property");
  for (int i = 0; i &lt; elemList.Count; i++)
  {
      if (elemList[i].Attributes["value"] != null)
      {
          AppProperty property = new AppProperty(elemList[i].Attributes["name"].Value, elemList[i].Attributes["value"].Value);
          properties.Add(property);
      }
  }
  </code></pre>
  
  <p>Then I send it to the form and update the form dataset:
  Form1.cs</p>
  
  <pre><code>private void Form1_Load(object sender, System.EventArgs e)
  {
      this.dataGridView1.SelectionMode =
      DataGridViewSelectionMode.FullRowSelect;
      this.dataGridView1.DataSource = properties;
      this.dataGridView1.AutoGenerateColumns = false;
  }
  </code></pre>
  
  <p>Now when the user edits I trigger an event listener: Form.cs</p>
  
  <pre><code>private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
  {
      updater.updateSave();
  }
  </code></pre>
  
  <p>This then goes back to my updater class and saves the document:Updater.cs</p>
  
  <pre><code>public void updateSave()
  {
      foreach (string f in filePaths)
              doc.Save(f);
  }
  </code></pre>
  
  <p>The file looks like it was saved since it has updated the "Date Modified: " to the moment i used the save. I'm sure there is some reference-value mix up but I cannot figure it out</p>
  
  <p><em>How come the changes are not being made?</em> </p>