With Saxon PE and Saxon EE you can get a guid in your xslt with the command:
<xsl:attribute name="xr:uid" select="java:randomUUID()" xmlns:java="java:java.util.UUID"/>