xsl:when expands to
<xsl:when test=""/>
xsl:choose + xsl:when is the equivalent of if, else if… like so
<xsl:choose>
<xsl:when test="">
…
</xsl:when>
<xsl:when test="">
…
</xsl:when>
<xsl:otherwise>
…
</xsl:otherwise>
</xsl:choose>
xsl:when will thus always contain the action to perform if the test matches, so should actually expand to
<xsl:when test=""></xsl:when>
instead of the self-closing variant, so you can actually write inside the element the action to perform.
