- simplexml_load_string: documentation ( source)
<?php
$xml = <<< XML
<Export id="123" apples="pears">
<Works foo="bar" id="234"/>
<Doesnt bar="foo" id="345">Stack Exchange</Doesnt>
</Export>
XML;
$export = simplexml_load_string($xml);
echo $export->doesnt['bar'];