The best way to deal with Caps Lock is to make it a Control Key when used as a modifier (held down when another key is pressed), but Escape when typed by itself. There's a program for GNU/Linux called xscape that does exactly that.
You should be able to do that with only XKB, but Xorg XKB seems somewhat buggy and the documentation is scattered, so you'd have a bit of work ahead of you.