Environment variables in config.xml?


I need to have some environment variables in config.xml, or an equivalent way to dynamically set values in that file. What is the recommended approach for something like this?

Just as an example, suppose I need to decide the widget version setting at build time, etc.