I\'ve created an XML editor and I\'m stuck at the last phase: adding undo/redo functionality.
I\'ve only got to add undo/redo for when users add elements, attributes
I would try to create an Action class, with a AddElementAction class inheriting off Action. AddElementAction could have a Do() and Undo() method which would add/remove elements accordingly. You can then keep two stacks of Actions for undo/redo, and just call Do()/Undo() on the top element before popping it.