module Hpricot::Container::Trav

def replace_child(old, new)

Replace +old+, a child of the current node, with +new+ node.
def replace_child(old, new)
  reparent new
  children[children.index(old), 1] = [*new]
end