private function getXpath()
{
if ($this->_document instanceof Document) {
return $this->_document->xpath();
} elseif (isset($this->_xpath) && (\FluentDOM::$isHHVM || $this->_xpath->document === $this->_document)) {
return $this->_xpath;
} else {
$this->_xpath = new Xpath($this->getDocument());
$this->applyNamespaces();
return $this->_xpath;
}
}