That's ok, as long as all your "bad" elemenets are at the beginning. You could also try using parameters, that way your "format_name" template does not have to rely on using the current node:
Code:
<xsl:template name="format_name">
<xsl:param name="current" select="."/>
</xsl:template>
Called by:
Code:
<xsl:call-template name="format_name">
<xsl:with-param select="."/>
</xsl:call-template>
<xsl:call-template name="format_name">
<xsl:with-param select="following-sibling::*[not(@attr = 'bad')][1]"/>
</xsl:call-template>
If you don't pass a parameter the current node will be used.
Joe (MVP - xml)
--
Joe