title: Edit specific Element in XDocument
body: <p>I recently started learning C# and I ran into a problem using <code>XML.Linq</code> to store data. I hope the question is understandable as I am not familiar with all the correct terms yet and as English isn't my first language.</p>
  
  <p>I read a lot of Questions/googled but I can not figure it out myself.</p>
  
  <p>I want to update an existing XDocument File that looks like this:</p>
  
  <pre><code>&lt;Data&gt;
    &lt;IDCounter&gt;2&lt;/IDCounter&gt;
    &lt;Highscores&gt;
       .......
    &lt;/Highscores&gt;
    &lt;savegames&gt;
      &lt;savegame&gt;
         &lt;IdNumber&gt;1&lt;/IdNumber&gt;
         &lt;salutation&gt;Mr&lt;/salutation&gt;
         &lt;prename&gt;Prename1&lt;/prename&gt;
         &lt;surname&gt;Surname1&lt;/surname&gt;
         &lt;maximumbalance&gt;100&lt;/maximumbalance&gt;
         &lt;balance&gt;100&lt;/balance&gt;
      &lt;/savegame&gt;
      &lt;savegame&gt;
         &lt;IdNumber&gt;2&lt;/IdNumber&gt;
         &lt;salutation&gt;Mr&lt;/salutation&gt;
         &lt;prename&gt;Prename2&lt;/prename&gt;
         &lt;surname&gt;Surname2&lt;/surname&gt;
         &lt;maximumbalance&gt;100&lt;/maximumbalance&gt;
         &lt;balance&gt;100&lt;/balance&gt;
       &lt;/savegame&gt;
     &lt;/savegames&gt;
  &lt;/Data&gt; 
  </code></pre>
  
  <p>What is the easiest way to change a value in a specific Element?</p>
  
  <p>Let's say I want to change the <strong>balance</strong> of a specific <strong>savegame</strong>.</p>
  
  <p>I want to access the savegame by <strong>IdNumber</strong> (these numbers are unique)</p>
  
  <p>Then I want to change the value of <strong>balance</strong> (for example to 50) and then save these changes to my document.</p>