/**
* Joins an XPath expression as an adjacent of another.
*
* @param XPathExpr $xpath The parent XPath expression
* @param NodeInterface $sub The adjacent XPath expression
*
* @return XPathExpr An XPath instance
*/
protected function _xpath_direct_adjacent($xpath, $sub)
{
// when sub immediately follows xpath
$xpath->join('/following-sibling::', $sub->toXpath());
$xpath->addNameTest();
$xpath->addCondition('position() = 1');
return $xpath;
}