Had some issues with getElementById() while searching for a specific element in a XHTML document.
I wrote a small function what was solving my problem:
<?php
function getElementById($id)
{
$xpath = new DOMXPath($this->domDocument);
return $xpath->query("//*[@id='$id']")->item(0);
}
?>