menu.xml<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="menu.xsl"?>
<menu>
<item id="1">Menu 1</item>
<item id="2">Menu 2</item>
<item id="3">Menu 3</item>
<item id="4">Menu 4</item>
<item id="5">Menu 5</item>
</menu>
menu.xsl<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="menu">
<html>
<head>
<title>XML Y javascript EN UNO</title>
</head>
<body>
<xsl:for-each select="item">
<xsl:apply-templates select="."/>
</xsl:for-each>
</body>
</html>
</xsl:template>
<xsl:template match="item">
<a href="#" onclick="alert('Hola:');void(0)">
<xsl:value-of select="text()"/>
<br/>
</a>
</xsl:template>
</xsl:stylesheet>
Fuente: :http://www.forosdelweb.com/f26/xml-javascript-185124/#post633964