The Sum function works without 'for-each' rule in Saxon mapping. However, we are unable to use the Sum function with 'for-each' rule on the target schema.
sum($Input_Schema_DBSchema/DB/Trans[POLICY_INSURED_NUMBER_ = $varPolicyNo]/PAYMENT_CEDING_)
To utilize the Sum function in the mapping with 'for-each' rule, we need to create a Custom XSL Before and define 'for-each' rule in that Custom XSL. After defining 'for-each' rule, change the transformer of mapping XSL from 'Saxon' to 'Xalan'. After modifying the mapping, it works as expected.