X is doing very well thanks. The basic protocol is fine, and with modern extensions (render, composite, XI2), is fundamentally competitive with anything out there.
XCB is on the rise, and does a good job of fixing the problems of the Xlib API.
Xorg and Mesa are in the process of fixing the actual implementation of X and the graphics stack in general (DRI/DRM2, KMS, GEM, evdev, and of course Gallium3D is brilliant (plus delicious LLVM)).
Cairo, of course has no relation to X, other than X was the first platform it supported). If X ever was replaced, Cairo would actually be a big enabler, as a lot of stuff just uses Cairo these days and doesn't touch X directly, so as long as Cairo supported the new system...
As far as Apple FOSSing Quartz, all I have to say is: AHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
Apple isn't really into self mutilation, so that's not going to happen.