- var_dump: documentation ( source)
<?php
$xml = <<<XML
<html>
<body>
<h1>test</h1>
</body>
</html>
XML;
$document = new DOMDocument();
$document->loadXML($xml);
$node = $document->getElementsByTagName('body')->item(0);
var_dump($node->nodeValue);