OK. The first time I followed to the end. 
The code I was forced to produce by time pressure is so ugly and dirty that I refuse to publish it.
Nevertheless a  clear demonstration for what was ISOS (aka COS) NOT designed for:
Higher mathematical calculus, matrix transformations, arrays with independent dimensions, ....
[ Though I have to admit that I encountered tensors, rotors, matrix transformations, Mr. Fermat's theories, ... only at university 50+ years ago. And I didn't miss it in between angel]

There was no demand for the real strengths of IRIS!
In addition, I verified my personal credo that writing some code in ISOS/COS
only because it is possible makes no sense and is of no commercial value.
Especially with the broad range of options in  IRIS to include external code.   

I fully support you.
Out of tradition, there is a tendency to implement already existing solutions though  better
and well-positioned on the markets. 
@Dmitry Maslennikov :
- you might remember times when even a webserver was written inside Caché
- or various text editors, source manager packages, and ..., and ... and ...
JUST because it was possible.

Decades back you had your globals and your language and not even an OS below.
But this was in previous millenium. This time is definitely over.

 

The key issue I see is: Is there a Related XML schema available.
If YES:
- you can generate a package with the existing tools
- import the file with %XML.Reader
- do an %JSON... export
The XML schema is necessary because straight XML is just TEXT with no datatypes
while JSON has data types. For XML the type of data is documented in XML Schema.

If NO:
You may call any of the public available XML to JSON converters.
They may guess rather easy for numerics vs. strings in most cases.
But detecting Boolean (true /false ) vs. Integer is somewhat mysterious to me.

My personal opinion: re-inventing this wheel is not worth the effort.
Writing an adapter makes sense