This is an oft debated topic. The topic came up in the "Can anyone convince me not to get an XD" thread:
I'll cut and past what I said in that thread as to why I prefer the XD. Remember, the gun that feels best in your hand, aims the most naturally and meets all your needs is the best gun for you regardless of brand.
Ok, I'll bite with my opinion (and only my opinion which is worth as much as you paid for it):
I think the XD has 6 improvements over the Glock:
1) Backstrap safety (although some see it as a liability). I like having the extra passive safety. It is called "Glock leg" for a reason.
2) Traditional take down system. I do not like Glock's take down system. While there are 2 recommended methods of take down I am aware and neither require your hand be in front of the muzzle, I see most people using a method that puts their hand in front of the muzzle or causes them to point the muzzle at their body which I find to be troubling on a firearm which requires the trigger be pulled to disassemble. My experiences obviously may not be representative.
3) All models in all calibers have fully supported chambers and have had from the beginning.
4) The ramp rests on and is supported by the locking block rather than the magazine lip as in the Glock. Paired with the fully supporte chambers, in the case of an in-chamber cartridge failure, it is more likely that the chamber will contain the explosion.
5) More natural grip angle. While many obviously like or don't mind the Glock grip angle, many find their natural aim with it to point high. While this can be corrected with front sight height or practice, the XD has a more natural grip angle for many.
6) Perhaps the least discussed feature of the XD, although it is a patented feature on the pistol, is the slight extension of the guide rod/recoil spring assembly face beyond the muzzle [SEE CORRECTION BELOW]
(tactical models have a guide rod/recoil spring whereas the service and subcompact models have a recoil spring assembly). The face sticks out about 1/8" past the slide/muzzle. The design purpose of this is to allow full lock up into battery after a contact shot while maintaining contact. A feature that certainly rarely comes into play, however, in the case of a hand to hand struggle for your life it may be the factor that allows the follow-up shot and saves your life.
EDITED: Correction as to #6 - the guide rod on the tactical models does not stick out that far and I obviously misremembered as to that issue. My apologies for any confusion my mis-statement may have caused. The original HS-2000 on which the XD is based was only made in what is now called the "service" (4") model and had this feature. I looked for the actual patent which I have seen before, I think linked from XDtalk, but am unable to locate it. I did find this information regarding the design:
"Springfield advertising literature calls this a "muzzle protector", but the original text of patent WO02059539, published in August 01, 2002 and granted to the Croatian design team, describes the reason for this feature as to "enable firing the bullet when the pistol is pushed towards someone's back". This is "necessary" because HS2000, as almost any other modern pistol, has a disconnector safety that does not permit the release of the striker if the slide is not fully closed and locked to the barrel, and such situation can be easily encountered in circumstances described in the quote." http://world.guns.ru/handguns/hg48-e.htm