Payments from ref_no -- recursive CTE on T_TRANSACTION?

Hey y'all,

I'm writing a report that needs to output all payments that could have affected a contribution. I've been investigating, and it seems the (only?) foolproof method would be to do a recursive query on T_TRANSACTION, kind of bouncing back and forth between ref_no and transaction_no until we've got all the transaction_nos, and then joining all of those transactions to T_PAYMENT.

Anyone do anything like this before that I can steal, or have any thoughts on the topic?