Greetings.
Since XSLT 3.0 supports JSON, in addition to XML, I suppose that it would be better to convert most, if not all of this software to XSLT.
There is a fairly elaborated XSLT stylesheet which can be studied at.
https://github.com/metalink-dev/metalinks/blob/6c1ae69f8b456865464495b98a44c2844b001de6/webconvert/metalink.xsl
@namedgraph
Thank you for your support.