"Tree View" using XSLT / XML
<p>I try to build "tree" which should look sth like this</p>

<pre><code>-group1
    *jobA
    *jobB
-group2
    *jobC
-group3
    *jobD
</code></pre>

<p>but now using code which is below I'm getting</p>

<pre><code>-group1
     *group2
            +group3
</code></pre>

<p>From this i get list of groups and when I call template I want to get list of jobs in each group</p>

<pre><code>                        &lt;td&gt;
                            &lt;ul&gt;
                                &lt;xsl:variable name="unique-list" select="DEFTABLE/TABLE/JOB[not(@GROUP=following::JOB/@GROUP)]" /&gt;
                                &lt;xsl:for-each select="$unique-list"&gt;
                                    &lt;li&gt;
                                        &lt;a href="#{@GROUP}"&gt;
                                            &lt;xsl:value-of select="@GROUP" /&gt;
                                        &lt;/a&gt;
                                        &lt;xsl:call-template name="ListJob"&gt;
                                            &lt;xsl:with-param name="group" select="@GROUP"/&gt;
                                        &lt;/xsl:call-template&gt;
                                    &lt;/li&gt;
                                &lt;/xsl:for-each&gt;
                            &lt;/ul&gt;
                        &lt;/td&gt;
</code></pre>

<p>And my template</p>

<pre><code>&lt;xsl:template name="ListJob"&gt;
    &lt;xsl:param name="group"/&gt;
    &lt;ul&gt;
        &lt;xsl:for-each select="DEFTABLE/TABLE/JOB[@GROUP=$group]"&gt;
            &lt;li&gt;
                &lt;xsl:value-of select="@JOBNAME"/&gt; 
            &lt;/li&gt;
        &lt;/xsl:for-each&gt;
    &lt;/ul&gt;
&lt;/xsl:template&gt;
</code></pre>

<p>The XML files looks sth like this</p>

<pre><code>&lt;DEFTABLE&gt;
&lt;TABLE&gt;
&lt;JOB NAME="jobA" GROUP="group1"/&gt;
&lt;/TABLE&gt;
&lt;/DEFTABLE&gt;
</code></pre>

<p>What I'm doing wrong ? </p>