First define your identity template which copies everything unchanged:
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
Declare a global variable holding your second file:
<xsl:variable name="file2" select="document('file2.xml')"/>
Then add a template rule that modifies the element you want to change:
<xsl:template match="TransferType"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:copy-of select="$file2//TransferType[@rdf:ID = current()/@rdf:ID]/*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
This kind of thing is much harder in XQuery, which doesn't support this "copy everything exactly except X" coding pattern. To do the same thing in XQuery, you'll have to wait for XQuery updates to be supported.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference