... if you had that xml as json object then the stored procedure would work just fine
also the stored procedure will return a json object ...
I think we have to add here that the stored procedure itself cannot handle xml or json data in a structured way w/o doing an own parser implementation. The example in the linked post uses the XSJS API which does the json handling, but not the procedure itself does not either parse an input json or create an result json. So if you use an XSJS approach you can go with that approach, via JDBC it is not possible w/o doing additional stuff.