I own a G26, G34, and a XD 5" 45.
XD advantages:
ambidextrous mag release
light rail on all models (glocks don't have it on the baby glocks)
somewhat easier to take apart
XD 45 has a much thinner grip vs G21
grip angle is a bit nicer ( glock's isnt bad, but XD is a bit better)
stock XD trigger somewhat better then stock glock trigger
can shoot lead ammo out of a stock XD
Glock advantages
considerably longer track record, lots of LE and MIL testing
the 9mm glocks have more mag capacity vs the xd 9's
load chamber indicator doesn't foul up like the xd's
easier to get parts
cheaper mags
sights on glock MUCH MUCH MUCH easier to add / remove / adjust
glock trigger has MUCH better reset vs XD, glock 3.5 trigger is roughly same as the XD with the better reset
slide MUCH easier to rack
easier to find a gunsmith to work on one if needed
more holsters and mods for glock
overall opinion:
Both are REALLY good guns and are fairly similar in operation. Your choice of caliber will have an impact on which one you'll want. IMHO, the Glocks are great in 9mm, the XD rules in 45, and 40 its probably a wash (though I do hear that the XD's are easier on brass in 40).
Best bet is to decide on a caliber, rent or borrow one, shoot it, then decide.