The thing akin to the "this" keyword is the current() function - or if you prefer you can assign a variable.
Typical logic is
<xsl:variable name="table1" select="document('table1.xml')/table"/>
<xsl:variable name="table2" select="document('table2.xml')/table"/>
<xsl:for-each select="table1/row">
<output>
<c><xsl:value-of select="dataFromTable1"/></c>
<d><xsl:value-of select="$table2/row[@primary-key = current()/@foreign-key]/dataFromTable2"/></d>
</output>
</xsl:for-each>
For greater efficiency, and some would say greater clarity, use keys:
<xsl:variable name="k1" match="table1/row" use="@primary-key"/>
then in XSLT 2.0:
<d><xsl:value-of select="key('k1', current()/@foreign-key, $table1)"/></d>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference