just use below function
SELECT XMLTOJSON(XMLTYPE('<xml><firstName>John</firstName><lastName>Smith</lastName></xml>')) AS json_output FROM DUAL;