What would you use to alter an XML-file while preserving as much as possible of layout, including indentation and comments?
My problem is that I have a couple of massive hand-edited XML-files describing a user interface, and now I need to translate several attributes to another language.
I've tried doing this using Python + ElementTree, but it did not preserve neither whitespace nor comments.
I've seen XSLT being suggested for similar questions, but I don't think that is an alternative in this case, since I need to do some logic and lookups for each attribute.
It would be preferable if attribute order in each element is preserved as well, but I can tolerate changed order.