When you type "startx", all it does is execute this file:
This file contains different commands that help set up options in X (like font size, config locations), and then executes any commands you place there. If GNOME is starting, then the command to start GNOME is in the file.
There are two options.
1. Just edit that file and remove the "gnome-session" part (this is the command to start GNOME) and add "startkde".
2. Have multiple xinitrc files, and just specifiy at runtime, like:
Also, if you type "xwmconfig", I believe it will set up your xinitrc file with the WindowManager you choose.