title: Reading SOAP XML in PHP
body: <p>I do a SOAP-call to my client. It returns a XML-document as a string (this is a workaround that I can't do anything about). I have the XML in a variable and I need to read this XML to grab the information I want.</p>
  
  <p>I am looking for the fields <code>DomesticCustomer</code>, <code>Addresses</code> and <code>GridOwner</code>. I guess if someone helps me to get to the <code>DomesticCustomer</code>-part I can do the rest on my own.</p>
  
  <p>Note: In this example, there is only one entry under each field, but there could be multiple, so I need to be able to foreach this.</p>
  
  <p><strong>Note #2: Because the client I use has some weird workaround for this to work, the response (the xml) is a simple string.</strong></p>
  
  <p>The XML is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;soap:Body&gt;
          &lt;MeteringPointIdResponse xmlns="http://www.ediel.no/schemas/public/nubix/MeteringPointIdResponse"&gt;
              &lt;RequestId xmlns=""&gt;3423424234&lt;/RequestId&gt;
              &lt;Requestor xmlns=""&gt;
                  &lt;GLN&gt;234234234&lt;/GLN&gt;
              &lt;/Requestor&gt;
              &lt;Customers xmlns=""&gt;
                  &lt;DomesticCustomer&gt;
                      &lt;LastName&gt;Name&lt;/LastName&gt;
                      &lt;FirstName&gt;Name&lt;/FirstName&gt;
                      &lt;BirthDate&gt;xxx-xx-xx&lt;/BirthDate&gt;
                      &lt;MeterNumber&gt;xxxxx&lt;/MeterNumber&gt;
                      &lt;Addresses&gt;
                          &lt;Address&gt;
                              &lt;Address1&gt;345345&lt;/Address1&gt;
                              &lt;PostCode&gt;3514&lt;/PostCode&gt;
                              &lt;Location&gt;xxxxxx&lt;/Location&gt;
                              &lt;CountryCode&gt;xx&lt;/CountryCode&gt;
                              &lt;Installation&gt;
                                  &lt;Description&gt;xxxxx&lt;/Description&gt;
                                  &lt;MeteringPointId&gt;xxxxxxxxxxxxxxx&lt;/MeteringPointId&gt;
                                  &lt;MeteringMethod&gt;xxxxxx&lt;/MeteringMethod&gt;
                                  &lt;InstallationStatus&gt;xxxx&lt;/InstallationStatus&gt;
                                  &lt;LastReadOffDate&gt;xxxx-xx-xx&lt;/LastReadOffDate&gt;
                              &lt;/Installation&gt;
                              &lt;GridOwner&gt;
                                  &lt;GLN&gt;xxxxxxx&lt;/GLN&gt;
                                  &lt;Name&gt;xxxxxxxx&lt;/Name&gt;
                                  &lt;ProdatAddress&gt;
                                      &lt;InterchangeRecipient&gt;
                                          &lt;Id&gt;xxxxxxx&lt;/Id&gt;
                                          &lt;Qualifier&gt;xx&lt;/Qualifier&gt;
                                          &lt;Subaddress&gt;xxxxx&lt;/Subaddress&gt;
                                      &lt;/InterchangeRecipient&gt;
                                      &lt;Party&gt;
                                          &lt;Id&gt;xxxxxxxxxx&lt;/Id&gt;
                                          &lt;CodeListResponsible&gt;xxxx&lt;/CodeListResponsible&gt;
                                      &lt;/Party&gt;
                                      &lt;EDISyntax&gt;
                                          &lt;CharSet&gt;xxx&lt;/CharSet&gt;
                                          &lt;SyntaxId&gt;xxxx&lt;/SyntaxId&gt;
                                      &lt;/EDISyntax&gt;
                                      &lt;SMTPAddress&gt;test@hey.com&lt;/SMTPAddress&gt;
                                  &lt;/ProdatAddress&gt;
                              &lt;/GridOwner&gt;
                          &lt;/Address&gt;
                      &lt;/Addresses&gt;
                  &lt;/DomesticCustomer&gt;
              &lt;/Customers&gt;
          &lt;/MeteringPointIdResponse&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>