Inserted callback for deletions.
Deleted useless TopLevelXMLHook.