Hi,
<xsl:when test="anElement"> ... <xsl:otherwise> ...
That's supposed to be: <xsl:when test="normalize-space(anElement)">