title: PowerShell: How to add XmlElement to a non-root element
body: <p>I'm having trouble adding an XmlElement to a non-root element in PowerShell.</p>
  
  <p>Basically, given this xml:</p>
  
  <pre><code>&lt;clubs&gt;
          &lt;club name="boca" position="1"&gt;
                  &lt;field&gt;bombonera&lt;/field&gt;
                  &lt;field&gt;bombonerita&lt;/field&gt;
          &lt;/club&gt;
          &lt;club name="racing" position="19"&gt;
                  &lt;field&gt;cilindro&lt;/field&gt;
          &lt;/club&gt;
  &lt;/clubs&gt;
  </code></pre>
  
  <p>I want to achieve this</p>
  
  <pre><code>&lt;clubs&gt; 
          &lt;club name="boca" position="1"&gt; 
                  &lt;field&gt;bombonera&lt;/field&gt; 
                  &lt;field&gt;bombonerita&lt;/field&gt; 
          &lt;/club&gt; 
          &lt;club name="racing" position="19"&gt; 
                  &lt;field&gt;cilindro&lt;/field&gt; 
          &lt;/club&gt; 
          &lt;club name="barracas" /&gt;
  &lt;/clubs&gt;
  </code></pre>
  
  <p>I create an element,</p>
  
  <pre><code>$new = $clubs.CreateElement("barracas")
  </code></pre>
  
  <p>When I try to add this element to a non-root node i.e.</p>
  
  <pre><code>$clubs.clubs.club += $new
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>Cannot set "club" because only strings can be used as values to set XmlNode properties.
  </code></pre>
  
  <p>What am I missing?</p>