The way I currently handle this is by having multiple config files such as:
web.config web.Prod.config web.QA.config web.Dev.config
When th
Transforms seem really helpful for this. You can replace certain sections with different rules.
http://msdn.microsoft.com/en-us/library/dd465318(v=vs.100).aspx