Replaces one child with another, making sure the nodelist is correct @param
to_replace the child to replace (must be a Child) @param replacement the child to insert
into the nodelist (must be a Child)
# File lib/rexml/parent.rb, line 140
def replace_child( to_replace, replacement )
@children.map! {|c| c.equal?( to_replace ) ? replacement : c }
to_replace.parent = nil
replacement.parent = self
end