- simplexml_load_string: documentation ( source)
- print_r: documentation ( source)
<?php
$string = <<<XML
<?xml version='1.0'?>
<document>
<0>Forty What?</0>
<from>Joe</from>
<to>Jane</to>
<body>
I know that's the answer -- but what's the question?
</body>
</document>
XML;
$xml = simplexml_load_string($string);
print_r($xml);