foo bar baz XML; $xml = new SimpleXMLElement($xmlstr); $result = $xml->node; echo $result; // foo echo "\n\n"; var_dump($result); /* object(SimpleXMLElement)#2 (1) { [0]=> string(3) "foo" } */ echo "\n\n"; print_r($result); /* SimpleXMLElement Object ( [0] => foo ) */ ?>