I have this xml object which is passed to a php variable called $var\_PersonalStatus

```
<Statuses>
  <Status>
    <Name>Surviving Spouse</Name>
    <CreatedDate>2017-05-18</CreatedDate>
  </Status>
  <Status>
    <Name>Spouse</Name>
    <CreatedDate>2017-05-18</CreatedDate>
  </Status>
</Statuses>

```

if I print out the variable $var\_PersonalStatus i get the whole xml like this: 

```
Retiree2017-09-28Next of kin2017-09-28Retiree2017-09-28Employee2017-09-28
Deceased2017-09-28Next of Kin2017-09-28Retiree2017-09-28Spouse2017-09-282017-09-27

```

I want to be able to access the last node using PHP so that i can place just the last field "Name" in a select box. So far I been using this:

```
<?php
$xml = simplexml_load_string($var_PersonalStatus);
if ($var_PersonalStatus != '') {
  foreach($xml as $dta => $fd){
    $var_Ps = $fd->Name;
  }
}

```

but all i get is the first node name not the last one...
 Thanks for the help