This is the output of print_r() run on a typical SimpleXMLElement object:
SimpleXMLElement Object
(
[@attributes] => Array
(
Sorry, can't comment as a guest but for anyone else who ends up here like I did... I am creating my own Joomla form fields and Joomla creates a very 'interesting' object of all sorts of things. Now, I didn't want to become a SimpleXML expert, all I wanted was the original label text which was squirrelled away in @attributes.
After a bit of "hmmm, I wonder if this works?"™ I found this is the easiest way of accessing these values:
var_dump($simpleXMLObject);
/* Result */
object(SimpleXMLElement)
public '@attributes' =>
array (size=3)
'name' => string 'awesome'
'label' => string 'Awesome Label'
'type' => string 'typeOfAwesome'
echo $simpleXMLObject->attributes()->label; // Awesome Label
$simpleXMLObject->attributes()->label = 'Different Day, Different Awesome';
echo $simpleXMLObject->attributes()->label; // Different Day, Different Awesome
They were not lying. It really is simple.