Computations in RTF Template



I am new to Bi Publisher Reporting. I am changing an invoice report to add Price (Product of Quantity and Unit Price) . I try to store it in a variable and to get subtotal of invoice but its not working.
Price Formula working fine: <?xdofx: to_number(LIST_PRICE) * (C_ORDERED_QUANTITY)?>

Then i am trying to save result of this calculation in a variable 'Pr' to get subttotal.... something is going wrong and this is not saving value.

<?xdoxslt:set_variable($_XDOCTX, 'Pr', xdoxslt:get_variable($_XDOCTX, 'Pr'+(LIST_PRICE * C_ORDERED_QUANTITY)?>

<?xdoxslt:set_variable($_XDOCTX, ’RTotal’, xdoxslt:get_variable($_XDOCTX,’RTotal’) + Pr)?>

'RTotal' is another variable i am using to add Price and taxes later to get grand total.

I try to add This new Price in xml thru oracle report builder but xml is not accepting any change.

Can anyone help me point to the rite direction to get subtotal ....