Steve - Is there a chance you could post a before and after example, so we can see just what you are trying to do instead of talking conceptually all around it and making us guess? If you are just doing some spot translations of specific values in an HTML file, you can probably get away with a simple (but readable) program using pyparsing.
-- Paul -- http://mail.python.org/mailman/listinfo/python-list