title: Overwrite specific XML node
body: <p>I have a XML file of the following format:</p>
  
  <pre><code>&lt;Alarms&gt;
     &lt;Alarm&gt;
        &lt;Id&gt;1&lt;/Id&gt;
        &lt;Severity&gt;Warning&lt;/Severity&gt;
        &lt;Comments&gt;&lt;/Comments&gt;
     &lt;/Alarm&gt;
     &lt;Alarm&gt;
        &lt;Id&gt;2&lt;/Id&gt;
        &lt;Severity&gt;Error&lt;/Severity&gt;
        &lt;Comments&gt;Restart the machine&lt;/Comments&gt;
     &lt;/Alarm&gt;
     ...
  </code></pre>
  
  <p>My program has a GUI which gives the user the ability to edit the <code>Comments</code> of an alarm. I am trying to come up with the best solution for the actions to take when a user is done editing and wants to save the changes. The XML file isn't extremely large (it does not warrant a database) but large enough that I do not want to overwrite the entire thing every time a change is made to a single alarm. Is it possible to target only a specific node and edit the <code>Comments</code> attribute without then having to re-write everything?</p>
  
  <p>I'm looking for a XML-specific solution... I want to avoid regular flat-file methods that involve going to a specific line in a file and then editing that line. Perhaps something exists for XML files that I'm not privy to. I'm currently working with a .NET 2 project but will soon be upgrading to 4.5, so any solution works for me.</p>