<xsl:key name="x" match="name" use="lname"/>
...
<xsl:for-each
select="(names/name[generate-id(.)=generate-id(key('x',lname))])[position()>3]">
<name>
<xsl:copy-of select="lname"/>
<first>
<xsl:copy-of select="key('x',lname)/fname"/>
</first>
</name>
</xsl:for-each>
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list