I have this as xml:
&
Another approach is to use SimpleXML
for parsing and DOMDocument
for manipulation/access, which bypasses namespacing issues altogether:
$xml = new SimpleXMLElement($r);
$xml = dom_import_simplexml($xml);
$nodelist= $xml->getElementsByTagName('event');
for($i = 0; $i < $nodelist->length; $i++) {
$sessions = $nodelist->item($i)->getElementsByTagName('sessionKey');
echo $sessions->item(0)->nodeValue;
}