resurrecting an old thread . . .
I have no xsl training but for my sins have to poke about with it.
I'm a bit mystified by this:
$enumber-levels[$depth]
enumber-levels is defined by this:
<xsl:variable name="enumber-levels" select="(true(), true(), true(), false())" />
depth is a numerical count.
From a syntax guide, the syntax of e1[e2] "Square brackets enclose a predicate, which specifies an expression e2 that selects nodes from a larger set e1."
So I don't know how the variable 'depth' can be selecting from 'enumber-levels'.