Subtotalling issue

Hi all,

I hope someone can help me with this. I have a range of holding categories(18 in total). Each needs to be displayed as a seperate table and its contents subtotalled. This is fine for me. However if the category is ‘Mutual Funds’, ‘Bond Funds’, ‘Short-term Funds’, ‘Stock Funds’ or ‘Other’, I need to display them in one table called Mutual Funds and subtotal all their values. I have them displaying in one table. I cant figure out how to subtotal them so Id be really grateful if anyone could help me out.

Heres the XSL Im using for this part

<xsl:if test=“(contains($AllHoldings, ‘Mutual Funds’)) or (contains($AllHoldings, ‘Stock Funds’)) or (contains($AllHoldings, ‘Bond Funds’)) or (contains($AllHoldings, ‘Short-term Funds’)) or (contains($AllHoldings, ‘Other’)) “>


Mutual Funds
<xsl:call-template name=“Headers”/>
<xsl:for-each select=“Account_Holding_Asset_Category”>
<xsl:variable name=“textBeforePercent” select=“substring-before(Hld_Acct_Pcent_Fnte, ‘%’)”/>
<xsl:variable name=“holdingsType” select=“translate($textBeforePercent, ‘0123456789’, ‘’)”/
<xsl:if test=”(($holdingsType = 'Mutual Funds ') or ($holdingsType = 'Stock Funds ') or ($holdingsType = 'Bond Funds ') or ($holdingsType = 'Short-term Funds ') or ($holdingsType = 'Other '))”>
<xsl:apply-templates select=“Account_Security_Holding_Detail”/>
</xsl:if>
</xsl:for-each>






Subtotal of Mutual Funds <xsl:value-of select=“sum(Account_Security_Holding_Detail/Hld_Beg_Sec_Mkt_Amt)”/> <xsl:value-of select=“sum(Account_Security_Holding_Detail/Hld_End_Sec_Mkt_Amt)”/>  

</xsl:if>

Heres some XML

<Account_Holding_Asset_Category>
<Hld_Acct_Pcent_Fnte>Mutual Funds 60% of holdings</Hld_Acct_Pcent_Fnte>
<Account_Security_Holding_Detail>
<Hld_Descr_Symb_Txt1>mfFIDELITY EQUITY INCOME ( FEQIX )</Hld_Descr_Symb_Txt1>
<Hld_Sec_Qty_Amt>95306</Hld_Sec_Qty_Amt>
<Hld_Sec_Prc_Amt>48.730</Hld_Sec_Prc_Amt>
<Hld_Sec_Cost>4,726.80</Hld_Sec_Cost>
<Hld_Beg_Sec_Mkt_Amt>4624.05</Hld_Beg_Sec_Mkt_Amt>
<Hld_End_Sec_Mkt_Amt>4644.26</Hld_End_Sec_Mkt_Amt>
</Account_Security_Holding_Detail>
<Account_Security_Holding_Detail>
<Hld_Descr_Symb_Txt1>mfFIDELITY FREEDOM 2010 ( FFFCX )</Hld_Descr_Symb_Txt1>
<Hld_Sec_Qty_Amt>93131</Hld_Sec_Qty_Amt>
<Hld_Sec_Prc_Amt>12.880</Hld_Sec_Prc_Amt>
<Hld_Sec_Cost>unknown</Hld_Sec_Cost>
<Hld_Beg_Sec_Mkt_Amt>1186.71</Hld_Beg_Sec_Mkt_Amt>
<Hld_End_Sec_Mkt_Amt>1199.53</Hld_End_Sec_Mkt_Amt>
</Account_Security_Holding_Detail>
</Account_Holding_Asset_Category>
<Account_Holding_Asset_Category>
<Hld_Acct_Pcent_Fnte>Bond Funds 23% holdings</Hld_Acct_Pcent_Fnte>
<Account_Security_Holding_Detail>
<Hld_Descr_Symb_Txt1>mfBond Fund ( SMT )</Hld_Descr_Symb_Txt1>
<Hld_Sec_Qty_Amt>4000</Hld_Sec_Qty_Amt>
<Hld_Sec_Prc_Amt>$87.720</Hld_Sec_Prc_Amt>
<Hld_Sec_Cost>$600.00</Hld_Sec_Cost>
<Hld_Beg_Sec_Mkt_Amt>12.34</Hld_Beg_Sec_Mkt_Amt>
<Hld_End_Sec_Mkt_Amt>9133.44</Hld_End_Sec_Mkt_Amt>
</Account_Security_Holding_Detail>
</Account_Holding_Asset_Category>
<Account_Holding_Asset_Category>
<Hld_Acct_Pcent_Fnte>Short-term Funds 4% holdings</Hld_Acct_Pcent_Fnte>
<Account_Security_Holding_Detail>
<Hld_Descr_Symb_Txt1>Short Term</Hld_Descr_Symb_Txt1>
<Hld_Sec_Qty_Amt>2.000</Hld_Sec_Qty_Amt>
<Hld_Sec_Prc_Amt>$47.720</Hld_Sec_Prc_Amt>
<Hld_Sec_Cost>$0.00</Hld_Sec_Cost>
<Hld_Beg_Sec_Mkt_Amt>97.34</Hld_Beg_Sec_Mkt_Amt>
<Hld_End_Sec_Mkt_Amt>95.44</Hld_End_Sec_Mkt_Amt>
</Account_Security_Holding_Detail>
</Account_Holding_Asset_Category>

Thanks in advance,
Noreen