I have an example of exactly this sort of thing in my "Upgrading ACS to OpenACS" document.
I consider it to be hack-level, but for a one-time upgrade, it seems like it will do the work.
I'll ignore whether or not this is a good idea, or whether it would be better to do it with tDOM. If you're looking for the regexp, see:
http://rubick.com/openacs/acs_to_openacs