Pete
this is what I got from a fellow programmer in other team and it does work !
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="compare.xsl"?>
<files>
<file href="file1.xml" />
<file href="file2.xml" />
</files>
<xsl:stylesheet version="1.0"
xmlns:xsl="
<xsl

utput method="xml" indent="yes"/>
<xsl:variable name="file1"
select="document(/files/file[1]/@href, /)" />
<xsl:variable name="file2"
select="document(/files/file[2]/@href, /)" />
<xsl:template match="/">
<compare_result>
<changed_items>
<xsl:apply-templates select="$file1//BORROWER" mode="changed"/>
</changed_items>
<deleted_items>
<xsl:apply-templates select="$file1//BORROWER" mode="deleted"/>
</deleted_items>
<added_items>
<xsl:apply-templates select="$file2//BORROWER" mode="added"/>
</added_items>
<unchanged_items>
<xsl:apply-templates select="$file1//BORROWER" mode="unchanged"/>
</unchanged_items>
</compare_result>
</xsl:template>
<xsl:template match="//BORROWER" mode="deleted">
<xsl:variable name="borrowerID" select="@XNT_IVP_ID"/>
<xsl:if test="not($file2//BORROWER[@XNT_IVP_ID=$borrowerID])">
Deleted: <xsl:copy-of select="."/>
</xsl:if>
</xsl:template>
<xsl:template match="//BORROWER" mode="changed">
<xsl:variable name="borrowerID" select="@XNT_IVP_ID"/>
<xsl:if test="$file2//BORROWER[@XNT_IVP_ID=$borrowerID]">
<xsl:if test="not(.=$file2//BORROWER[@XNT_IVP_ID=$borrowerID])">
Changed: <xsl:copy-of select="."/>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="//BORROWER" mode="added">
<xsl:variable name="borrowerID" select="@XNT_IVP_ID"/>
<xsl:if test="not($file1//BORROWER[@XNT_IVP_ID=$borrowerID])">
Added: <xsl:copy-of select="."/>
</xsl:if>
</xsl:template>
<xsl:template match="//BORROWER" mode="unchanged">
<xsl:variable name="borrowerID" select="@XNT_IVP_ID"/>
<xsl:if test="$file2//BORROWER[@XNT_IVP_ID=$borrowerID]">
<xsl:if test=".=$file2//BORROWER[@XNT_IVP_ID=$borrowerID]">
Unchanged: <xsl:copy-of select="."/>
</xsl:if>
</xsl:if>
</xsl:template>
</xsl:stylesheet>