I've created a simple tag template builder for xml, however, I didn't know why there is no automatic undo redo feature (ctrl+z) for the added tags.
Here is a live sample: (press Run >> to activate it)
https://www.w3schools.com/code/tryit.asp?filename=GCGLRN2F8PWD
Please note: there is undo redo function for text that was typed manually, but not for added text from the buttons above. My guess is maybe because those added tags are like "built in" feature that the system doesn't just detect.
IMAGE :