One way of telling dev and prod apart is to create an Environment variable on the TeamCity server, which can then be turned into a parameter using the Groovy plugin and a little bit of scripting.
Though it would be a nice option, if the portable DSL could access environment variables when generating, so a more optimal XML configuration could be generated.