I have a recursive nodes that I'm trying to set up for jquery-checktree. The nodes look like
foo/bar/ID
/NAME
/CHECKED
bar/ID
/NAME
/CHECKED
/bar/ID
/NAME
/bar/ID
/NAME
/bar/ID
/NAME
/CHECKED
/bar/ID
/NAME
/CHECKED
Where any bar may or may not have one or more bar nodes below it, but any bar will have ID and NAME and might have a CHECKED.
and I want to turn that into
<ul>
<li><input type="checkbox" name="..." value="..." checked="checked"></input>
<label for="...">...</label>
<ul>
<li><input type="checkbox" name="..." value="..." checked="checked"></input>
<label for="...">...</label>
</li>
</ul>
<li>....</li>
</ul>
I can get the first level by doing:
<ul class="tree">
<xsl:for-each select="/foo/bar/">
<li><input type="checkbox" name="{ID}" value="{ID}">
<xsl:if test="CHECKED = 'Y'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
</input><label for="{ID}"><xsl:value-of select="NAME"/></label>
</li>
</xsl:for-each>
</ul>
But I don't know how to recurse down to the embedded "bar" within the "bar", down to however many levels there might be.