Reading SOAP XML in PHP
Got a little problem here that I guess should be no big deal. I get an XML-response from a SOAP-call that I need to foreach in PHP. The problem is that I can't figure out how to read the document so I can grab the information I want.

I am looking for the fields `DomesticCustomer`, `Addresses` and `GridOwner`. I guess if someone helps me to get to the `DomesticCustomer`-part I can do the rest on my own.

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.

**Note #2: Because the client I use has some weird workaround for this to work, the response (the xml) is a simple string.**

The XML is:

    <?xml version="1.0" encoding="utf-8"?>
    <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">
        <soap:Body>
            <MeteringPointIdResponse xmlns="http://www.ediel.no/schemas/public/nubix/MeteringPointIdResponse">
                <RequestId xmlns="">3423424234</RequestId>
                <Requestor xmlns="">
                    <GLN>234234234</GLN>
                </Requestor>
                <Customers xmlns="">
                    <DomesticCustomer>
                        <LastName>Name</LastName>
                        <FirstName>Name</FirstName>
                        <BirthDate>xxx-xx-xx</BirthDate>
                        <MeterNumber>xxxxx</MeterNumber>
                        <Addresses>
                            <Address>
                                <Address1>345345</Address1>
                                <PostCode>3514</PostCode>
                                <Location>xxxxxx</Location>
                                <CountryCode>xx</CountryCode>
                                <Installation>
                                    <Description>xxxxx</Description>
                                    <MeteringPointId>xxxxxxxxxxxxxxx</MeteringPointId>
                                    <MeteringMethod>xxxxxx</MeteringMethod>
                                    <InstallationStatus>xxxx</InstallationStatus>
                                    <LastReadOffDate>xxxx-xx-xx</LastReadOffDate>
                                </Installation>
                                <GridOwner>
                                    <GLN>xxxxxxx</GLN>
                                    <Name>xxxxxxxx</Name>
                                    <ProdatAddress>
                                        <InterchangeRecipient>
                                            <Id>xxxxxxx</Id>
                                            <Qualifier>xx</Qualifier>
                                            <Subaddress>xxxxx</Subaddress>
                                        </InterchangeRecipient>
                                        <Party>
                                            <Id>xxxxxxxxxx</Id>
                                            <CodeListResponsible>xxxx</CodeListResponsible>
                                        </Party>
                                        <EDISyntax>
                                            <CharSet>xxx</CharSet>
                                            <SyntaxId>xxxx</SyntaxId>
                                        </EDISyntax>
                                        <SMTPAddress>test@hey.com</SMTPAddress>
                                    </ProdatAddress>
                                </GridOwner>
                            </Address>
                        </Addresses>
                    </DomesticCustomer>
                </Customers>
            </MeteringPointIdResponse>
        </soap:Body>
    </soap:Envelope>
Reading SOAP XML in PHP
===

Got a little problem here that I guess should be no big deal. I get an XML-response from a SOAP-call that I need to foreach in PHP. The problem is that I can't figure out how to read the document so I can grab the information I want.

I am looking for the fields `DomesticCustomer`, `Addresses` and `GridOwner`. I guess if someone helps me to get to the `DomesticCustomer`-part I can do the rest on my own.

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.

**Note #2: Because the client I use has some weird workaround for this to work, the response (the xml) is a simple string.**

The XML is:

    <?xml version="1.0" encoding="utf-8"?>
    <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">
        <soap:Body>
            <MeteringPointIdResponse xmlns="http://www.ediel.no/schemas/public/nubix/MeteringPointIdResponse">
                <RequestId xmlns="">3423424234</RequestId>
                <Requestor xmlns="">
                    <GLN>234234234</GLN>
                </Requestor>
                <Customers xmlns="">
                    <DomesticCustomer>
                        <LastName>Name</LastName>
                        <FirstName>Name</FirstName>
                        <BirthDate>xxx-xx-xx</BirthDate>
                        <MeterNumber>xxxxx</MeterNumber>
                        <Addresses>
                            <Address>
                                <Address1>345345</Address1>
                                <PostCode>3514</PostCode>
                                <Location>xxxxxx</Location>
                                <CountryCode>xx</CountryCode>
                                <Installation>
                                    <Description>xxxxx</Description>
                                    <MeteringPointId>xxxxxxxxxxxxxxx</MeteringPointId>
                                    <MeteringMethod>xxxxxx</MeteringMethod>
                                    <InstallationStatus>xxxx</InstallationStatus>
                                    <LastReadOffDate>xxxx-xx-xx</LastReadOffDate>
                                </Installation>
                                <GridOwner>
                                    <GLN>xxxxxxx</GLN>
                                    <Name>xxxxxxxx</Name>
                                    <ProdatAddress>
                                        <InterchangeRecipient>
                                            <Id>xxxxxxx</Id>
                                            <Qualifier>xx</Qualifier>
                                            <Subaddress>xxxxx</Subaddress>
                                        </InterchangeRecipient>
                                        <Party>
                                            <Id>xxxxxxxxxx</Id>
                                            <CodeListResponsible>xxxx</CodeListResponsible>
                                        </Party>
                                        <EDISyntax>
                                            <CharSet>xxx</CharSet>
                                            <SyntaxId>xxxx</SyntaxId>
                                        </EDISyntax>
                                        <SMTPAddress>test@hey.com</SMTPAddress>
                                    </ProdatAddress>
                                </GridOwner>
                            </Address>
                        </Addresses>
                    </DomesticCustomer>
                </Customers>
            </MeteringPointIdResponse>
        </soap:Body>
    </soap:Envelope>