class Nokogiri::XML::Node

def add_previous_sibling node_or_tags

Also see related method +before+.

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+ before this Node (as a sibling).
##
def add_previous_sibling node_or_tags
  raise ArgumentError.new("A document may not have multiple root nodes.") if parent.is_a?(XML::Document) && !node_or_tags.is_a?(XML::ProcessingInstruction)
  add_sibling :previous, node_or_tags
end