XD and Glock are both fantastic guns, it all comes down to your personal preference.
I find XD to be far more comfortable to hold and shoot, but my best friend's Glock is what feels natural to him.
Quality-wise you can't go wrong.
Rent and shoot both, if possible, before making your purchase!