class Nokogiri::XML::NodeSet

def index(node)

Returns the index of the first node in self that is == to +node+. Returns nil if no match is found.
##
def index(node)
  each_with_index { |member, j| return j if member == node }
  nil
end