In this developerWorks forum posting a string manipulation [percent encoding for an encoding unsupported by str:encode-uri()/str:decode-uri()] was needed:
At least the encode-uri would have been far more difficult to do in XSLT than in GatewayScript.
So the stylesheet and GatewayScript shown in that posting show
- how to call GatewayScript from XSLT [dp:gatewayscript()] and pass XML
- how to access the passed XML in GatewayScript
- how to do percent encoding [.charAt() and .charPointAt()]
- how the response looks like in XSLT