class Nokogiri::XML::Node

def add_child(node_or_tags)

Also see related method +<<+.

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

Add +node_or_tags+ as a child of this Node.
##
def add_child(node_or_tags)
  node_or_tags = coerce(node_or_tags)
  if node_or_tags.is_a?(XML::NodeSet)
    node_or_tags.each { |n| add_child_node_and_reparent_attrs(n) }
  else
    add_child_node_and_reparent_attrs(node_or_tags)
  end
  node_or_tags
end