Combining XSL and JavaScript

To get an XSL stylesheet to output XML with JavaScript in it, do this:

<?xml version="1.0" encoding="us-ascii"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
    <xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.1//EN"
        cdata-section-elements="javascript-escape" />
    <xsl:template match="/">
        <html xmlns="" xml:lang="en">
                <title>The Marriage of XSL and JavaScript</title>
                <script type="text/javascript">
                    /* <javascript-escape> <![CDATA[ */
                    function load() {
                        alert("All your bases are belong to us.");
                    /* ]]> </javascript-escape> */
            <body onload="load()">
                <p>Captain: You know what you doing.</p>