Here is an example of both using JSON as the XSLT source document and outputing the template result tree as JSON.