I have a soap xml response and I want to get the value of the leadReferenceNumber node. 

I'm not sure if I'm doing it correctly.

Here's my code:

```
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns2:CreateLeadResponse xmlns:ns9="http://www.momentum.co.za/crm/service/type/fault/SystemFault/v1.0" xmlns:ns8="http://www.momentum.co.za/crm/service/type/ProductCategoryType/v1.0" xmlns:ns7="http://www.momentum.co.za/crm/service/type/CampaignType/v1.0" xmlns:ns6="http://www.momentum.co.za/crm/service/type/PreferredContactMethodType/v1.0" xmlns:ns5="http://www.momentum.co.za/crm/service/type/LanguageType/v1.0" xmlns:ns4="http://www.momentum.co.za/crm/service/type/TitleType/v1.0" xmlns:ns3="http://www.momentum.co.za/crm/service/type/application/Lead/v1.0" xmlns:ns2="http://www.momentum.co.za/crm/service/application/CRMLeadService/v1.0"><leadReferenceNumber>LP1391743548576</leadReferenceNumber></ns2:CreateLeadResponse></soapenv:Body></soapenv:Envelope>';

$soap = simplexml_load_string($xml);
$response = $soap->children();
$test = (string)$response->leadReferenceNumber;

echo $test;

```