Sometimes you need unique identifiers in the output.
generate-id(node) will return the same unique identifier for a given node.
generate-id() just returns a value--your schema says if it is valid where you use it.
Example:
<xsl:template match="annotation"> <xsl:copy> <xsl:attribute name="id"><xsl:value-of select="generate-id(.)"/></xsl:attribute> </xsl:copy> </xsl:template>