- var_dump: documentation ( source)
<?php
$xml = <<<XML
<?xml version="1.0"?>
<a>
<b>
<c>
<value a="1">Some Value</value>
</c>
</b>
</a>
XML;
$a = new SimpleXMLElement($xml);
$nodes = $a->xpath('/a/b/c/value');
$node = $nodes[0];
if ($node) {
echo "Element is not empty";
} else {
echo "Element is empty";
}
var_dump((array)$node);
var_dump((bool)$node);