I came across How to convert XML to JSON in ASP.NET C# (link) and one in javascript (at goessner.net/download/prj/jsonxml/). But have yet to find one in c++ that takes just a st
Ideally this would be done using XSLT instead writing a translator in C++/C#. You can find some solutions online (for example this one).
However, if you would prefer to do it in C++ then I recommend the jsoncpp library.