While I generally shoot my XD45 better (well, more accurately, at least) than I do my 9mm Glocks, I’d recommend the Glock 17 in this instance as a first or only pistol. I also generally prefer .45 acp, but even hand loading this caliber is getting too expensive for me. The 9mm is relatively inexpensive to shoot, always available, and appears to be plenty effective with the right loads.
Grip is so subjective that I can’t make a real recommendation, and unless you have very unusual hands you’ll be able to adapt well to the XD45 or the 9mm Glocks. For me, my G34 (I think same grip frame as the G17) definitely felt the most awkward at first, and still doesn’t feel as nice as say a CZ75, 1911, any XD or even my G19 in my hand. It is nothing a few thousand rounds couldn’t cure. Even the oft-cited “pointability” concern is eliminated with enough practice.
But my recommendation is primarily due to caliber, NOT for any performance reasons. If you were choosing between 9mm versions of both makes, I’d say it’s more of a toss-up. Glocks have better availability of factory and aftermarket parts. I like the XD ergos better.