The reason comments are not processed is because the default template for comments does nothing:
<xsl:template match="processing-instruction()|comment()"/>
See XSLT 1.0 Specification for Built-in Template Rules .
If you want to do something else with comments, you can simply create your own matching template and output them as a new XML comment using xsl:comment or create an HTML list:
<xsl:template match="/"> <ul> <xsl:apply-templates select="//comment()"/> </ul> </xsl:template> <xsl:template match="comment()"> <li> <xsl:value-of select="."/> </li> </xsl:template>
source share