title: Remove xml node -Xelement
body: <p>I have a xml file from which only specific nodes have to be removed. The node name will be given as input from the user. How to remove the specific nodes which have requested from the user?</p>
  
  <pre><code>&lt;Customers&gt;    
    &lt;Customer&gt;    
      &lt;id&gt;michle&lt;/id&gt;
      &lt;address&gt;newjersy&lt;/address&gt;    
    &lt;/Customer&gt;    
    &lt;Customer&gt;    
      &lt;id&gt;ann&lt;/id&gt;
      &lt;address&gt;canada&lt;/address&gt;    
    &lt;/Customer&gt;
  &lt;/Customers&gt;
  </code></pre>
  
  <p>I have tried   </p>
  
  <pre><code>var customer = new XElement("customer",
        from o in customers
        select 
            new XElement("id", id),
            new XElement("address", address)
          );
  </code></pre>
  
  <p>Customer will contain a new node </p>
  
  <pre><code>&lt;Customer&gt;    
    &lt;id&gt;ann&lt;/id&gt;
    &lt;address&gt;canada&lt;/address&gt;    
  &lt;/Customer&gt;
  </code></pre>
  
  <p><code>doc.Element("customers").Elements(customer).ToList().Remove();</code>  </p>
  
  <p>but this is not working. How can I remove the element from the xml?</p>