class Nokogiri::XML::Node

def add_next_sibling(node_or_tags)

Also see related method +after+.

Returns the reparented node (if +node_or_tags+ is a Node), or NodeSet (if +node_or_tags+ is a DocumentFragment, NodeSet, or string).

+node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a string containing markup.
Insert +node_or_tags+ after this Node (as a sibling).
##
def add_next_sibling(node_or_tags)
  raise ArgumentError.new("A document may not have multiple root nodes.") if (parent && parent.document?) && !(node_or_tags.comment? || node_or_tags.processing_instruction?)
  add_sibling :next, node_or_tags
end