Например, вот
так и
так.
Что-то типа такого:
<?php
$xmlString = <<<'XML'
<?xml version="1.0" encoding="UTF-8" ?>
<tns:RequestAndResponse xmlns:tns="com.dtn.aghost.weather.weatherService">
<request>
<tns:Credentials>
<usernamePasswordCombo>
<username>E0E0E0</username>
<password>E0E0E0</password>
</usernamePasswordCombo>
</tns:Credentials>
</request>
<response>
<tns:AccountToken expires="2015-10-12T15:20:13.000Z">
<Token>E0E0E0E1E1E1</Token>
<URLEncodedToken>E0E0E0E1E1E1</URLEncodedToken>
</tns:AccountToken>
</response>
</tns:RequestAndResponse>
XML;
$xml = new SimpleXMLElement($xmlString);
foreach ($xml->xpath('//tns:Credentials') as $credentials) {
var_dump($credentials->usernamePasswordCombo->username, $credentials->usernamePasswordCombo->password);
}
foreach ($xml->xpath('//tns:AccountToken') as $token) {
var_dump($token->Token, $token->URLEncodedToken);
}