class Nokogiri::XML::Node

def <=>(other)

different documents cannot be compared.
Compare two Node objects with respect to their Document. Nodes from
##
def <=>(other)
  return nil unless other.is_a?(Nokogiri::XML::Node)
  return nil unless document == other.document
  compare(other)
end