$xml_string="<?xml version='1.0'?>
<moleculedb>
<molecule name='ball'>
<symbol>ball</symbol>
<code>A</code>
</molecule>
<molecule name='car'>
<symbol>honda city</symbol>
<code>K</code>
</molecule>
</moleculedb>";
$xml = simplexml_load_string($xml_string);
foreach ($xml->molecule as $record)
{
echo $record['name'], ' ';
echo $record->symbol, ' ';
echo $record->code, '<br />';
}Get XML data using PHP.
