For some bizarre reason, today I wanted to switch from kdm to gdm without leaving the gui. I opened up gnome-terminal and entered
sudo dpkg-reconfigure gdm
and selected gdm.
Then the part I was proud of: I opened screen and typed
sudo service kdm stop; sudo service gdm start
It worked perfectly, and I was presented with the gdm login screen.