Hi All. Can anyone assist me in the proper XSLT for this scenario?

I am trying to create two "div" layers from the two "<entity type="list"...> nodes, that contain the list items from the child "Listitem" nodes.

What i want returned is this visually:


Nav1 01
Nav1 02
Nav1 03

Nav2 01
Nav2 02
Nav2 03


What I get from my XSL is this:


Nav1 01
Nav1 02
Nav1 03

Nav2 01
Nav2 02
Nav2 03

Nav1 01
Nav1 02
Nav1 03

Nav2 01
Nav2 02
Nav2 03



Below is the XML and XSL....

XML Data:
Code:
<?xml version="1.0"?>
<pageelement xsl="tn_test.xsl">
	<contents>
		<entity type="list" id="nav1">
			<contents>
				<entity type="listitem">
					<item>Nav1 01</item>
					<Link loc="Homepage" page="Home"/>
				</entity>
				<entity type="listitem">
					<item>Nav1 02</item>
					<Link loc="Homepage" page="Home"></Link>
				</entity>
				<entity type="listitem">
					<item>Nav1 03</item>
					<Link loc="Homepage" page="Home"></Link>
				</entity>
			</contents>
		</entity>
		<entity type="list" id="nav2">
			<contents>
				<entity type="listitem">
					<item>Nav2 01</item>
					<Link loc="Homepage" page="Home"/>
				</entity>
				<entity type="listitem">
					<item>Nav2 02</item>
					<Link loc="Homepage" page="Home"></Link>
				</entity>
				<entity type="listitem">
					<item>Nav2 03</item>
					<Link loc="Homepage" page="Home"></Link>
				</entity>
			</contents>
		</entity>
	</contents>
</pageelement>

XSLT:

Code:
<xsl:template>
<xsl:apply-templates select="document($xmlfile)//entity[@type='list']" mode="buildnav"/>
</xsl:template>

<xsl:template match='entity' mode='buildnav'>
    <div style="visibility:visible;">
    <xsl:attribute name="id">
         <xsl:value-of select="@id"/>
    </xsl:attribute>
    
    <table width="100" border="0" cellpadding="2" cellspacing="0">
           <xsl:apply-templates select='//entity[@type="listitem"]' mode='topnav'/>
     </table>
     </div>
</xsl:template>
	
<xsl:template match='entity' mode='topnav'>
     <tr><td bgcolor="#6699CC" style="color:white;">
            <strong>
            <xsl:value-of select="item"/>
            </strong>
      </td></tr>
</xsl:template>