Use a template to allow conditional comments to be defined programmatically:
<xsl:template name="conditionalComment">
<xsl:param name="qualifier" select="'IE'"/>
<xsl:param name="contentRTF" select="''" />
<!--Use entity variables to allow invalid XML output from an XSLT processor-->
<xsl:comment>[if <xsl:value-of select="$qualifier"/>]<![CDATA[>]]>
<!--Use copy-of rather than value-of to preserve tag delimiters-->
<xsl:copy-of select="$contentRTF" />
<!--Use CDATA to output raw characters-->
<![CDATA[<![endif]]]></xsl:comment>
</xsl:template>
The template takes two parameters:
<xsl:call-template name="conditionalComment">
<!--Conditional check parameter-->
<xsl:with-param name="qualifier" select="'lte IE 6'"/>
<!--Stylesheet parameter-->
<xsl:with-param name="contentRTF">
<link rel="stylesheet" type="text/css" href="ie-win-fixup.css" />
</xsl:with-param>
</xsl:call-template>
References