in reply to Storing Substitution Output String

Sounds like a job for XSLT (tan-tan-tan-tan-tanaaa!)