If you are the type to make changes, add or change parts and personalize the pistol, there's a lot more options for the Glock platform.
Glock parts are simple, cheap, and made by a number of different sources. Availability is very good.
If you'd like more "features" as the pistol comes straight from the box, the XD was intended to mimic the Glock but expand on the features. The Glock offers a better loaded chamber indicator (if you like that), an ambi mag release, optional thumb safety, cocking indicator, more slide serrations, etc.
IMO, both are ugly, but the XD takes ugly to a whole new level.
Also IMO, I would rather find a used version of either (both are tough, well-built pistols) and save a little dough than to pay new money for either.