Use Muenchian grouping and then access the first item in each group:
Code:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:key name="by-id"
match="Att[@Ty = 'TM']"
use="@Id"/>
<xsl:template match="/">
<xsl:for-each select="Invoice/InvoiceItem/Set/Att[@Ty = 'TM'][generate-id() = generate-id(key('by-id', @Id)[1])]">
<xsl:value-of select="concat(@Id, '#10;')"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
--
Martin Honnen
Microsoft MVP - XML