private function fetchNodes($expression, \DOMNode $context = NULL, $options = 0)
{
$nodes = $this->_nodes->xpath($expression, $context);
if (!$nodes instanceof \DOMNodeList) {
throw new \InvalidArgumentException('Given selector/expression did not return a node list.');
}
$nodes = iterator_to_array($nodes);
if (Constraints::hasOption($options, self::REVERSE)) {
return array_reverse($nodes, FALSE);
}
return $nodes;
}