Hence my statement
" but I'm not entirely sure it will give you the result you are after"
This is your XML escaped to be a JSON fragment. This is not a XML-to-JSON conversion facility, it is a create JSON facility.
Take a look here for a tool that may be useful
https://odieweblog.wordpress.com/tag/xml-to-json/ For simpler requirements, using the native JSON/XML facilities might be enough
SQL> SELECT JSON_OBJECTAGG( id VALUE text )
2 FROM XMLTABLE(
3 '/xml/*'
4 PASSING XMLTYPE( '<xml><name>Connor</name></xml>')
5 COLUMNS id VARCHAR2(200) PATH './name()',
6 text VARCHAR2(200) PATH './text()'
7 );
{"name":"Connor"}