Have shot both, own an XD45C .. Personally wasn't comfortable with larger grip circumference of the G21 .. the SF version of the 21 solves that to the point where it feels about the same as the XD.

The XD's been around long enough to have the aftermarket finally catch up with it. I've got 1500 rounds or so through mine and haven't had any issues. Add to that the backstrap safety, I like it just a tad better than the 21SF's. Most folks I hear having issues with the Glock, have issues with the ergonomics. The XD is far more inline with a 1911's ergonomics than the near straight up and down that glock has. Again, personal preference.

Doubt you really can go wrong with either, do consider the XD45C .. allows for use of their 10rnd mags if you want to Conceal Carry with it and not have the longer grip to deal with.

I'll also note that the whole w/ rail, w/out rail debate when put in absolute terms such as "they are worthless" ect.. is unto itself worthless. If you're going to run a weapon light (as many of us do for very sound and practical reasons) then having the rail option is well worth it just for future flexibility. Keep in mind that running a weapon light is a matter of training and being use to activating it and not accidentally doing so.