I agree that you should handle both, if possible, before buying. The biggest real difference is in the grip, so how it fits your hand should be a primary consideration. I've shot a Glock 22, and I own an XD .40, so that's where my opinion comes from.
The XD has a 5" barrel, to the Glock's 4.5", so the XD feels slightly more front heavy, IMO. You also get a slightly longer sight radius. I find that the XD feels more solid and sturdy, less like a toy made of plastic (I'm definetly not suggesting that Glocks are fragile). The finish on a Glock's slide is very tough ... the finish on the XD's slide is .... not. I prefer the stainless steel magazine bodies for the XD over the Glock's plastic based mags. I find the XD grip a little slippery, since it does not have finger grooves like the current generation Glocks. I intend to add a Hogue Grip Sleeve to it, and I expect that will make it even more comfortable. Although the standard XD sights are quite acceptable (and made of metal, to the Glock's plastic sights), I'm also considering replacing them with night sights. The dovetail in the slide for the sights is the same as used by Sig, so lots of aftermarket sights are available.
I'm not sure if this is also true for the Glock, but keep in mind with the XD if you get the .40 S&W version, you can get a drop in 9mm barrel for the best of both worlds. You can't go the other way.
Especially taking into account the price difference, I'm very happy with the choice I made.
In the spirit of pissing off the Liberals, I think you should buy both.
