The XD is the "newer" kid on the block, and is an excellent pistol. That said, it seems to me that the XD a bit chunkier up top than the Glock 27. I would encourage you to go hold them side-by-side and see what you think.
Although a little more expensive, you might also check out the Kahr PM40.
I was at the same crossroad last week, I did as suggested and took some time to get the "feel" for each one, being a former Glock owner it was a difficult decision, but in the end I chose the XD40 and have not looked back.
These two are both great guns, both very reliable. The only great difference is the safety features. That will be your preference. XD has more safety features hands down. I also wanted to throw out looking at a Beretta px4. This is the exact same catagory. This is the gun I went with in the 40 Cal. Accuracy, reliability, and recoil is identical to the xd. Sent 300 rounds consecutive threw both xd and px4 without a hiccup. I simply went with the px4 because of its asthetics over the xd.
I personally like the Glock better. Most people on this forum will say XD though. I would go rent them both and shoot both of them. It all comes down to what you like the best. They will both extremely reliable, both accurate. They are both great guns. I personally like the way the glock feels and the angle of the grip over the XD, but for that same reason alot of people will go with the XD. Go shoot them both and make your own dicision.
I have the XD sub, an XD, a Glock G22 and my brother has a G27. I have probably shot my brother G27 more than my XD sub. I have a fair amount of experience with the full size vesions and the subs. I would take the XD over the Glock any day of the week and twice on Sunday.
Don't get me wrong, now that I have discovered the Hogue handall I am a huge fan of my G22, but it does not compare to the comfort, the felt recoil and the ergos of the XD.
The XD has some benefits that I feel are superior to the Glock.
1. The metal frame inserts are removable/replaceable if need be.
2. The mag release is ambidextrous. This is huge for me.
3. The chamber indicator is easier to see especially if the weapon is drawn up and aimed (it's on top the glock is on the side). And when the chamber is loaded the indicator is much easier to feel on the XD.
4. The XDm is made of match grade parts (barrel and slide)
5. The XD has a visual and physical indicator if it is "cocked."
6. The XD has a grip safety.
The Glock has capacity on the XD, but not the XDm.
Most of this though are my opinions. There are no substitutions for your experience. Go rent both, hell shoot both in all three calibers, there is a good chance you might like the Glock in one caliber and the XD in another. Then make you choice.
EDIT: Holy crap did anyone realize this thread is a year old and judging by his signature, I think he made his choice...LOL