protected function emptyElement()
{
$found = new \SplObjectStorage();
$matches = $this->candidateList();
foreach ($matches as $item) {
$empty = true;
foreach ($item->childNodes as $kid) {
// From the spec: Elements and Text nodes are the only ones to
// affect emptiness.
if ($kid->nodeType == XML_ELEMENT_NODE || $kid->nodeType == XML_TEXT_NODE) {
$empty = false;
break;
}
}
if ($empty) {
$found->attach($item);
}
}
$this->matches = $found;
}