That's exactly the sort of thing I was talking about (but didn't know enough to come up with myself).
Arrgh wrote:
Or we could play games
with hidden mutation... Uncontended synchronization for objects that
don't escape their creating thread is getting very cheap. ;)
I'm against that approach. The immutability of scala.xml is one of it's selling points compared to other XML libraries I've used -somehow or other I've always found a way to confuse and produce errors in them, that scala.xml should be immune to.