To pick out all the messages between blah1 and blah12, can't you just use:
<xsl:template match="message[preceding-sibling::message[contains(., 'blah1')] and following-sibling::message[contains(., 'blah12')]]">
<xsl:value-of select="."/>
<br/>
</xsl:template>
|