http://www.olegsych.com/2010/12/config-file-transformation/
Quite elegant solution except you have to create additional files manually.
Also the last section should be like this (to avoid double names of the app.config):
<ItemGroup>
<None Include="App.Debug.config">
<DependentUpon>App.config</DependentUpon>
</None>
<None Include="App.Release.config">
<DependentUpon>App.config</DependentUpon>
</None>
</ItemGroup>