class Nokogiri::XML::Node

def add_next_sibling(node_or_tags)

Also see related method +after+.

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

containing markup.
+node_or_tags+ can be a Nokogiri::XML::Node, a ::DocumentFragment, a ::NodeSet, or a String

Insert +node_or_tags+ after this Node (as a sibling).
##
def add_next_sibling(node_or_tags)
  raise ArgumentError,
    "A document may not have multiple root nodes." if parent&.document? && !(node_or_tags.comment? || node_or_tags.processing_instruction?)
  add_sibling(:next, node_or_tags)
end