This debate has been done to death, but I'll give my thoughts.
Better reputation for durable finish and reliability. Note: The XD has been through some torture tests as well and is considered very durable and reliable as well. The pre-2006 XDs used an inferior "Bruniral" finish, but now uses Melonite which is basically the same as the Glock's Tenifer finish.
Glock has a wider availability of aftermarket parts including holsters, sights, etc. It's generally harder to find parts for the XD, as well as gunsmiths who know how to fix them, and most people probably just send it back to Springfield if something needs fixing.
Glocks generally weigh less than comparable XDs.
The Glock has a quite shorter trigger reset which means it's easier to shoot rapidly. Note: The XD-M has a much improved trigger reset which is supposedly even shorter than the Glock's. I haven't tried it yet.
It comes with a mag pouch, crappy holster and mag loading tool. The holster and loading tool are pretty useless. I found the holster to have way too tight retention even when the retention screw was totally backed out. The loading tool was awkward to use and much slower than loading by hand or using the Uplula. The mag pouch is okay, although the fact that it holds the mags in a V shape is ergonomically weird and probably not optimal.
The XD has a fully supported chamber, which means it's less likely to have a "kaboom" type issue, especially with overly hot reloads. On the other hand, the Glock's less supported chamber supposedly reduces the chance of feeding failures.
The XD's barrel has traditional rifling, while the Glock's has polygonal rifling. Shooting unjacketed lead bullets through a stock Glock barrel isn't recommended.
The XD comes with metal sights, while the Glock comes with plastic, less durable sights. Note this doesn't apply if you are going to get night sights on your Glock anyways because the night sights are metal. The XD uses metal magazines while the Glock uses plastic mags. I don't think it necessarily matters but some might say the metal mags are more durable and more likely to drop free.
The XD has a 1911-style grip angle, which many shooters prefer.
The XD grip is considered more comfortable by most people, including me. The Glock grip is a bit wider and blockier.
The XD's trigger is a little crisper and less mushy.
The XD has a significant downside: the XD's slide can only be pulled back while the grip safety is depressed. That means that certain one handed malfunction clearing maneuvers may be made more difficult. It also means that if the grip safety mechanism breaks, there's a chance that the gun could be totally locked up, possibly with a live round in the chamber.
The XD has a grip safety, which some people like and some don't. I like the grip safety in concept, but the issues mentioned above regarding pulling the slide back make the XD's implementation of the grip safety very unattractive, unlike on the 1911, where you can pull the slide back without depressing the grip safety.
The XD has a loaded chamber indicator and cocking indicator. Note: Newer Glocks also have a LCI, and you can tell if it's cocked because the trigger is to the rear.
Both companies generally have excellent customer service. I believe the Glock warranty is one year, but they will generally fix your gun for free at any time. The XD's warranty is lifetime. I believe neither company cares if you're the original buyer.
The XD-M, Ruger SR-9, and S&W M&P are all somewhat newer designs in the same class that are worth considering. For example, they all have adjustable backstraps and none of them require dry firing to field strip. I'm not very familiar with them, so we'll leave it at that.