Have you configured a ~/.xsession?
If you login successfully with XDM, it'll take you to the default window manager. From there you can open a shell and modify /etc/ttys (commenting out the xdm line) using any editor you want.
If this doesn't work, can you try to kill X (ctrl + alt + backspace)?