Use the "modified identity transform" design pattern. Use a default template rule that copies elements unchanged (the "identity template"):
Code:
<xsl:template match="*">
<xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates/></xsl:copy>
</xsl:template>
and another that changes the elements you want to change:
Code:
<xsl:template match="SomeElement">
<xsl:copy>
<xsl:attribute name="newatt" select="'somevalue'"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>