As for myself, I agree that the XML format is not great, but I use the SQLite format, which allows me to write scripts on it.
Once in a while I dream of adding proper XML support to jq just to be able to use jq as a pithy alternative to XSLT.
If nothing else works, a Gnucash file is XML. A bit annoying to work with, but quite possible.
Does it allow setting values, or just reading?
[0] based on https://gist.github.com/nonducor/ddc97e787810d52d067206a592a...
Whenever I have to edit an xml file I tend to just go ham with python's xml library. the scripts are never pretty, mainly because they are whatever addhoc editing I wanted in written form. The hardest part is figuring out the xpath syntax.
A slight lie, I use lxml, mainly because it can select siblings which the built in xml lib is unable to do. but I still use the internal libs documentation, mainly because it is easier to read.