Put full XML file to list
<pre><code>  &lt;Clients&gt;
  &lt;Client Id="1"&gt;
    &lt;Name&gt;Granicentro&lt;/Name&gt;
    &lt;Adresses&gt;
      &lt;Adress Name=""&gt;
        &lt;Ip&gt;111,111,111,111&lt;/Ip&gt;
        &lt;Port&gt;1111&lt;/Porta&gt;
      &lt;/Adress&gt;
      &lt;Adress Name="2222"&gt;
        &lt;Ip&gt;222,222,222,222&lt;/Ip&gt;
        &lt;Port&gt;2222&lt;/Porta&gt;
      &lt;/Adress&gt;
      &lt;Adress Name="3333"&gt;
        &lt;Ip&gt;333,333,333,333&lt;/Ip&gt;
        &lt;Port&gt;3333&lt;/Porta&gt;
      &lt;/Adress&gt;
    &lt;/Adresses&gt;
  &lt;/Client&gt;
&lt;/Clients&gt;
</code></pre>

<p>I have this XML document. How do I get a list of all clients/addresses? </p>

<p>I have tried this without success(no exception, just no data to show):</p>

<pre><code>IEnumerable&lt;string&gt; adds= from client in XDocument.Load(@"D:\\Clients.xml")
  .Descendants("Adresses")
   where((string)cliente.Element("Name") == cliente)
   select cliente.Element("Ip").Value;
</code></pre>

<p>What is the proper way to add all the XML file to a list of this sort?:</p>

<pre><code>class Client
{
    public string ClientName{ get; set; }
    public List&lt;Adress&gt; Adresses{ get; set; }
}

class Adress
{
    public string AdressName{ get; set; }
    public string IP { get; set; }
    public int port{ get; set; }
}

List&lt;Client&gt; clientes = new List&lt;Client&gt;();
</code></pre>

<p><strong>Complete, and Verifiable example:</strong>
I just need the data from the XML file to manipulate at runtime.
Right now I have this query to get the name of the clients:</p>

<pre><code>            IEnumerable&lt;string&gt; names = from client in XDocument.Load(@"D:\W\Clients.xml")
                                                         .Descendants("client")
                                    orderby client.Element("Id") descending
                                    select client.Element("name").Value;
</code></pre>

<p>However, that only returns me the names, and I need all the data. Also, the number of addresses are variable.</p>

<p>Please edit the question and/or title as you see fit.Ignore any tipos, since i have translated this code from my native language.</p>