personal preference I'd say. Shot an XD9, and didn't like it as much as my G19. Higher bore axis, not as many parts available, cheaper mags (at least used to be, may have changed) and not a fan of grip safety in a carry gun either.
Whichever feels best in your hand is the perfect choice. I've owned both and prefer the XD. Others have owned or shot both and prefer the Glock. They are both dependable so go with the one you are most comfortable shooting.
I have had Glocks since the late '80s, when I sold off some pistols to get back to 9mm & .45acp one of the .40s was an XD. I really havent missed it at all.
Im a SA fan, the XDs are nice pistols. I guess that I just prefer the Glocks.... you either like the Glocks or you dont. Funny how everyone (manufacturers) want to copy them.... or make fun of them: KelTec and the Block ads...