Xmodmap performs the keymap switch. Here are the mapping files.
Make scripts (e.g. deutsch.sh and english.sh) using the following template, and put them in your path. Unzip the mapping files into the same directory.
#!/bin/bash xmodmap xmodmap.de
To set up shortcut keys for this, open gconf-editor, and go to apps | metacity | global_keybindings and | keybinding_commands. Here you can set up to twelve commands. Recommended key combo: Ctrl+Shift+Fxx. F11 English, F12 Deutsch.