Clash Of Titans!
Both are great options, I LOVE MY M9A1, but i have had some failures to cycle with the beast when it was dirty (200 rnds). It was with my wife and a buddy of mine shooting it. I personally had no problem, but i am adapt to stiff wristing with my Glock.
However I have never had a pistol that out of the box was such a nail puncher, the recoil is so smooth that you forget its a 9mm(not like a 9 has any real kick!!). But i havent put the kind of numbers through the beast to recomend it to you if this is going to be the weapon you would put your life, your familys life ,etc on the line with.
I also have a Glock 23 (.40 S&W) I have had it for 8+ years, I have used it for my duty carry weapon, i have 8000+ rounds through it with 2 FTF's that were caused by a weak mag spring... THAT IS THE ONLY PROBLEM EVER! I have shot it reliably with multiple types of ammo. The trigger caused some shot pulling problems that took me a while to overcome, but it just took some training (mental and range time.)
My duty carry weapon is a ISSUED Beretta 92D Vertec. I HIGHLY DONT RECOMEND ONE OF THESE! I have seen a lot of problems with these and for some reason they hurt my wrist after 10 shots???? i dont get this but ok!
But even though your comparison is between the two, Look at the Sigs, Browning highpowers(i recomend the old Belgium made version if you can find one that someone wants to part with and if you have the $$), Kimber 1911 9mm. JUST FIND ONE THAT FITS YOU! go to a large gun shop and put them in your hand when it feels rite thats you!
and me being a Glock man I have to say. DONT GO XD!
BUT My vote goes GLOCK!!