In case it wasn't clear in my earlier posting, the line <xsl:value-of
select="$grcontent"/> is just to demonstrate that the variable does indeed
have the text content you want to test. It isn't part of the solution, just
an attempt to illustrate how/why it (I hope) works, and so should be left
out of a "production" version.