I have doubts about the style of the DOM manipulation: the upcaster in the example creates the upcasted event as a modified copy of the old event; does this mean that in-place update is discouraged or wrong?
It’s been a while since that example was written, but if I recall correctly, the copying is necessary because you can’t just move en element to another location. That’s a Dom4J restriction. Therefore, a copy of an element is attached to its new location.
It’s fine to simply change the intermediate representation in-place. There is no need to treat them as immutable objects.