XSL Template:
<xsl:template match="cat">
<xsl:if test="methods">
<li class="direct_parent"><xsl:value-of select="@value"/>
<ul>
<xsl:apply-templates/>
</ul>
</li>
</xsl:if>
<xsl:if test="not(methods)">
<li><xsl:value-of select="@value"/>
<ul>
<xsl:apply-templates/>
</ul>
</li>
</xsl:if>
</xsl:template>
XML:
<cat value="jQuery">
<methods short='Adds each of the Elements in the array to the set of matched elements.' type='jQuery' name='add' cat='jQuery'>
<params type='Array<Element>' name='els'>
<desc>An array of Elements to add</desc>
</params>
<desc>Adds each of the Elements in the array to the set of matched elements.
This is used to add a set of Elements to a jQuery object.</desc>
<examples>
<code>$("p").add([document.getElementById("a"), document.getElementById("b")])</code>
<result>[ <p>Hello</p>, <span id="a">Hello Again</span>, <span id="b">And Again</span> ]</result>
<before><p>Hello</p><p><span id="a">Hello Again</span><span id="b">And Again</span></p></before>
</examples>
</methods>
</cat>
<cat value="DOM">
<cat value="Attributes">
<methods short='Get the current value of the first matched element.' type='String' name='val' cat='DOM/Attributes'>
<desc>Get the current value of the first matched element.</desc>
<examples>
<code>$("input").val();</code>
<result>"some text"</result>
<before><input type="text" value="some text"/></before>
</examples>
</methods>
</cat>
</cat>