Modify Xml using XDocument/XPath C#
<p>I am wondering about XDocument possibilities in relation to xml and how it can modify xml. Let's assume I have next xml:</p>

<pre><code>    &lt;client&gt;
        &lt;firstName&gt;Ian&lt;/firstName&gt;
        &lt;firstName&gt;Charles&lt;/firstName&gt;
        &lt;city&gt;LosAngeles&lt;/city&gt;
        &lt;state&gt;California&lt;/state&gt;
    &lt;/client&gt;
</code></pre>

<p>Can I leave there only one "firstname" node (which is at the very top) by using XDocument or XPath operations? I want to do something like .Distinct() operation does in LINQ. I want to make my resulting xml look like this:</p>

<pre><code>   &lt;client&gt;
       &lt;firstName&gt;Ian&lt;/firstName&gt;
       &lt;city&gt;LosAngeles&lt;/city&gt;
       &lt;state&gt;California&lt;/state&gt;
   &lt;/client&gt;
</code></pre>