- simplexml_load_string: documentation ( source)
<?php
$xml = "<xml>
<data>
<parameters>
<temperature>
<value name='1'></value>
<value name='2'></value>
</temperature>
</parameters>
</data>
</xml>";
$xml = simplexml_load_string( $xml);
foreach( $xml->data[0]->parameters[0]->temperature[0]->xpath( 'value') as $child) {
echo $child->attributes()['name'] . "\n";
}