title: Deserialize an xml file or parse using linq to xml
body: <p>Simplified XML file I need to decode:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;soap:Body&gt;
        &lt;ns2:deliverylistResponse xmlns:ns2="http://tdriverap3.wsbeans.iseries/"&gt;
           &lt;return&gt;
              &lt;COUNT&gt;3&lt;/COUNT&gt;
              &lt;DELIVERIES&gt;
                 &lt;ADD1&gt;1300 address 1&lt;/ADD1&gt;
                 &lt;CITY&gt;NICE CITY&lt;/CITY&gt;
                 &lt;ZIP&gt;85705&lt;/ZIP&gt;
              &lt;/DELIVERIES&gt;
              &lt;DELIVERIES&gt;
                 &lt;ADD1&gt;40 S PINAL PKWY AVE&lt;/ADD1&gt;
                 &lt;CITY&gt;FLORENCE&lt;/CITY&gt;
                 &lt;ZIP&gt;85132&lt;/ZIP&gt;
              &lt;/DELIVERIES&gt;
              &lt;DELIVERIES&gt;
                 &lt;ADD1&gt;1825 EAST MAIN&lt;/ADD1&gt;
                 &lt;CITY&gt;CHANDLER&lt;/CITY&gt;
                 &lt;ZIP&gt;85286&lt;/ZIP&gt;
              &lt;/DELIVERIES&gt;
              &lt;ERRORCODE/&gt;
              &lt;RUNDATE&gt;09/26/2018&lt;/RUNDATE&gt;
           &lt;/return&gt;
        &lt;/ns2:deliverylistResponse&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>I am using the following to try and decode each of the individual addresses in the code.</p>
  
  <p>I cannot figure out how to access them.</p>
  
  <pre><code>XElement xelement = XElement.Load(@"e:\test\X2.xml");
          IEnumerable&lt;XElement&gt; addresses = xelement.Elements();
  
          foreach (var address in addresses)
          {
              Console.WriteLine(address);
              Console.WriteLine(address.Element("CITY").Value);
  
          }
  </code></pre>
  
  <p>The first writeline works (it outputs the entire XML tree), the second says "System.Xml.Linq.XContainer.Element(...) returned null" - I have tried using DELIVERIES, COUNT, Body etc...</p>
  
  <p>Obviously I am not telling it correctly how to traverse the structure, but I do not know how to go any further with it..</p>
  
  <p>UPDATE: Thanks to some help I have figured out how to do it using Linq.
  I would still like to be able to deserialize it if anybody has a pointer.
  I followed several tutorials, but the multiple levels of this XML seems to be throwing me off.</p>
  
  <p>I have created a class to hold the data but that is as far as my success with that path has gone.</p>
  
  <p>Thank you,
  Joe</p>