I think the following is what you want:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" />
<xsl:template match="/*">
<xsl:copy>
<Root>
<xsl:for-each-group select="/Root/Summary" group-by="@ID">
<Summary Merchant_ID="{@ID}">
<!-- Copy values that are the same -->
<xsl:sequence select="ID, Batch_Date"/>
<!-- Sum the amounts -->
<Net_Sales_Amount>
<xsl:value-of select="format-number(sum(current-group()/Net_Sales_Amount), '0.00')"/>
</Net_Sales_Amount>
<!-- Combine the record types in this Summary element -->
<!-- <xsl:sequence select="DATA_From_2, DATA_From_3, DATA_From_5, DATA_From_8"/> -->
<xsl:for-each-group select="current-group()/*[starts-with(local-name(), 'DATA_')]" group-by="node-name(.)">
<xsl:apply-templates select="."/>
</xsl:for-each-group>
</Summary>
</xsl:for-each-group>
<Header>
</Header>
<Footer>
</Footer>
</Root>
</xsl:copy>
</xsl:template>
<xsl:template match="DATA_From_2 | DATA_From_5">
<xsl:copy>
<Sales_Amount>
<xsl:value-of select="format-number(sum(current-group()/Sales_Amount), '0.00')"/>
</Sales_Amount>
</xsl:copy>
</xsl:template>
<xsl:template match="DATA_From_8">
<xsl:copy>
<Invoice_Amount>
<xsl:value-of select="format-number(sum(current-group()/Invoice_Amount), '0.00')"/>
</Invoice_Amount>
<Invoice_Number>
<xsl:value-of select="current-group()/Invoice_Number" separator=" | "/>
</Invoice_Number>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>