class Nokogiri::XML::Node
def replace(new_node)
###
def replace(new_node) if new_node.is_a?(Document) || !new_node.is_a?(XML::Node) raise ArgumentError, <<-EOERR eplace requires a Node argument, and cannot accept a Document. robably want to select a node from the Document with at() or search(), or create a new Node via Node.new().) EOERR end replace_with_node new_node end