Usually people put JavaScripts inside CDATA sections, then you do not need to escape & and <.
<script>
<xsl:comment>
<![CDATA[
*** your script here ***
]]>
</xsl:comment>
</script>
Or, if you do not have lots of &s and <s, you can insert them as
< and &
Brendan, here is the trick: replace leadind & with &
i.e. to show < type &lt;