public function element($name)
{
$matches = $this->candidateList();
$this->findAnyElement = false;
$found = new \SplObjectStorage();
foreach ($matches as $item) {
// Should the existing item be included?
// In some cases (e.g. element is root element)
// it definitely should. But what about other cases?
if ($item->tagName == $name) {
$found->attach($item);
}
// Search for matching kids.
//$nl = $item->getElementsByTagName($name);
//$found = array_merge($found, $this->nodeListToArray($nl));
}
$this->matches = $found;
}