class Nokogiri::XML::NodeSet

def at path, ns = document.root ? document.root.namespaces : {}

first Node. Otherwise, index in to the array with +path+.
If path is a string, search this document for +path+ returning the
##
def at path, ns = document.root ? document.root.namespaces : {}
  return self[path] if path.is_a?(Numeric)
  search(path, ns).first
end