Its quite common for me to use a pipeline pattern where I take an input (lets assume xml) and transform it through a series of transformations into an output before returning it from the stylesheet.
These intermediary transforms most commonly use ‘apply-templates’ to ‘map’ (like a functor) the input to some new structure.
But if I map some input into a map/array structure (doesnt need to be JSON) I can’t see of a way to then apply-templates to it in the same way.
(my suspicion is it isnt directly supported)