title: xElement remove parent node
body: <p>I have an XDocument that I wish to remove the entire Allocation node when the Account node value = TEST</p>
  
  <pre><code>&lt;Order&gt;
    &lt;Quantity&gt;800&lt;/Quantity&gt;
    &lt;Allocations&gt;
      &lt;Allocation&gt;
         &lt;Account&gt;ACCT1&lt;/Account&gt;
         &lt;Quantity&gt;100&lt;/Quantity&gt;
      &lt;/Allocation&gt;
      &lt;Allocation&gt;
        &lt;Account&gt;TEST&lt;/Account&gt;
        &lt;Quantity&gt;300&lt;/Quantity&gt;  
      &lt;/Allocation&gt;
     &lt;Allocation&gt;
        &lt;Account&gt;ACCT4&lt;/Account&gt;
        &lt;Quantity&gt;400&lt;/Quantity&gt;
     &lt;/Allocation&gt;
   &lt;/&lt;Allocations&gt;
  &lt;/Order&gt;
  
  And my code:
  
  XElement root = XElement.Parse(util.DocAsString(xmlDoc));
  IEnumerable&lt;string&gt; acctList = from acct in root.Descendants("Account")
                                              select (string)acct;
  foreach (var acct in acctList)
   {
      root.Elements("Allocation").Where(aa =&gt; aa.Element("Account").Value == "TEST").Remove();
  }
  </code></pre>
  
  <p>However, this in not removing the node.  Please help, Thanks.</p>