To have the xslt-transformation done by the browser, the stylesheet processing instruction should appear before the first XML element (http://www.w3.org/TR/xml-stylesheet/) of the document;
It is possible to add the Processing Instruction by constructing it the following way:
processing-instruction xml-stylesheet {'type="application/xml"','href="test.xsl"'},
<myxml/>
The alternative is to use the transform() functions to do the transformation on the server side: