class REXML::XPathParser

def match(path_stack, nodeset)

def match(path_stack, nodeset)
  nodeset = nodeset.collect.with_index do |node, i|
    position = i + 1
    XPathNode.new(node, position: position)
  end
  result = expr(path_stack, nodeset)
  case result
  when Array # nodeset
    unnode(result)
  else
    [result]
  end
end