title: Adding multiple nodes at once in xml
body: <p>My xml is this:</p>
  
  <pre><code>&lt;Settings&gt;
      &lt;Ss&gt;&lt;/Ss&gt;
      &lt;Properties&gt;
          &lt;Property&gt;
              &lt;Name&gt;x&lt;/Name&gt;
              &lt;Description&gt;xx&lt;/Description&gt;
          &lt;/Property&gt;
              &lt;Property&gt;
              &lt;Name&gt;y&lt;/Name&gt;
              &lt;Description&gt;yyyyy&lt;/Description&gt;
              &lt;/Property&gt;
      &lt;/Properties&gt;
  &lt;/Settings&gt;
  </code></pre>
  
  <p>I want to add as a son of Properties an XElement. This is my code:</p>
  
  <pre><code>XDocument xmlDoc1 = XDocument.Load(@"C:\Users\John\Desktop\FileXml.xml");
  xmlDoc1.Element("Properties").Add(new XElement(addManyNodes));
  </code></pre>
  
  <p>But it doesn't work. It throws null reference exception. Why?</p>