<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def replace(old, new):
 """ A simple way to replace one element node with another. """

    parent = old.getparent()
    parent.replace(old, new)