Every undo, savepoint, and game save has the same problem — capture an object's private state so you can restore it later, without letting the thing holding the snapshot read or corrupt what's inside.
When your class hierarchy is stable but you keep bolting new operations onto every node — typecheck, pretty-print, evaluate, export — the Visitor pattern moves each operation into its own class so the nodes never change again.