A common approach is to have all your logic in your build tool, not in your CI server.
So add all your logic to transform web.config files & co in your build tool (msbuild, FAKE, nant, psake, etc)
And then add for each branch you want to cover one project to CCNet. You can do this easily with the Configuration PreProcessor to just change the branch name with a variable and have anything else same.