3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <InvokeServiceResponse xmlns="http://www.avanicimcon.com/XMLSchema"> <DXResponse TimeStamp="03/13/2014" Target="Test" Version="1.0"> <Success/> <UserInfo> <UserName> ttdxlu </UserName> </UserInfo> <ServiceDetails> <Providers> <Provider> ActlLookup </Provider> </Providers> <ServiceName> RetrieveHotelLocations </ServiceName> </ServiceDetails> <ResponseData> <Providers xmlns=""> <Provider Name="ActlLookup"> <RetrieveHotelLocationsRS xmlns="http://www.avanicimcon.com/XSD"> <CodeCategories> <CodeCategory ID="LCL" Name="LocationCodeList"> <Code ID="AU32" Value="Top End Northern Territory, Australia - Location" CountryID="AU" Type="Location"/> <Code ID="AU7" Value="Top End, Australia - Location" CountryID="AU" Type="Location"/> </CodeCategory> </CodeCategories> </RetrieveHotelLocationsRS> </Provider> </Providers> </ResponseData> </DXResponse> </InvokeServiceResponse> </s:Body> </s:Envelope>'; $xml = simplexml_load_string( $xml); foreach( $xml->xpath( './/InvokeServiceResponse') as $child) { echo $child->attributes()['xmlns'] . "\n"; }

preferences:
45.63 ms | 402 KiB | 5 Q