private function getPosition(\DOMNode $node)
{
$hash = spl_object_hash($node);
if (!array_key_exists($hash, $this->_cache)) {
$this->_cache[$hash] = (int) $this->_xpath->evaluate('count(ancestor-or-self::node()/preceding::node()) + count(ancestor::node())', $node);
}
return $this->_cache[$hash];
}