If every index value appears each file, then this isn't too difficult. Keys make it much more efficient:
<xsl:variable name="doc1" select="/">
<xsl:variable name="doc2" select="document('doc2.xml')"/>
<xsl:key name="k" match="DETAIL" use="@INDEX"/>
<xsl:template match="/">
<RECORDS>
<xsl:apply-templates select="RECORDS/DETAIL"/>
</RECORDS>
</xsl:template>
<xsl:template match="DETAIL">
<DETAIL>
<xsl:copy-of select="@*|*"/>
<xsl:copy-of select="key('k', @INDEX, $doc2)/*"/>
</DETAIL>
</xsl:template>
The 3-argument form of key() is XSLT 2.0 only, on 1.0 you have to write the circumlocution
<xsl:variable name="this" select="."/>
<xsl:for-each select="$doc2">
<xsl:copy-of select="key('k', $this/@INDEX)/*"/>
</xsl:for-each>
because key() only works when the node you want is in the same document as the context node.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference