- var_dump: documentation ( source)
- simplexml_load_string: documentation ( source)
- dom_import_simplexml: documentation ( source)
<?php
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<root>
<item id="images">
<images handle="kings-of-leon_poster_v02_webjpg" path="workspace/assets/uploads/" type="file">kings of leon_poster_v02_WEB.jpg</images>
</item>
<item id="about">
<page-name handle="new-age" type="page-name">New Age</page-name>
</item>
<item id="about">
<page-name handle="new-age-2" type="page-name">New Age 2</page-name>
</item>
<item id="images">
<images handle="aae_seating-plan_v01jpg" path="workspace/assets/uploads/" type="file">AAE_Seating-plan_v01.jpg</images>
</item>
<item id="images">
<images handle="evidence-of-communication-between-myself-and-external-sourcespng" path="workspace/assets/uploads/" type="file">evidence-of-communication-between-myself-and-external-sources.png</images>
</item>
</root>
';
$sxe = simplexml_load_string($xml);
$res1 = $sxe->xpath('//root/item[@id="images"]/descendant::*[@handle = "kings-of-leon_poster_v02_webjpg"]');
$item = dom_import_simplexml ($res1[0]);
var_dump($item);