Check if old and new are the same object instance in remplace_xml_element()