Just wanted to start by saying I have read a LOT of the questions on this site about this exact problem, but I\'m still struggling to apply it to my scenari
Did you try:
echo (string)$xml->product->attributes()->id;
That should give you access to the attributes.
If you have more than 1 product, it may be
echo (string)$xml->product[0]->attributes()->id;
You can also access the attributes using regular array notation such as:
$xml->product['id']; // instead of $xml->product->attributes()->id
See Example #5 from the SimpleXML Examples as well as the manual page on SimpleXMLElement::attributes() for more information.
$array = (array)$obj;
$prop_id = $array['@attributes'];