I've owned all three, XD, M&P and Glocks and I'm a Glock armorer. The XD I bought new broke on the 3rd mag of ammo I was running through it before I left the gun shop (G&L) they exchanged it for a M&P. The slide stop broke off, probably doesn't happen very often but it did happen. Then I got into Glocks, love the G19 and bought a new gen4 G17 for IDPA but after a summer of shooting and 3 different trigger connectors I still was shooting low left and didn't like the way it felt in my hand. The I decided to buy a M&P Pro 9mm 5" and have shot it all summer in IDPA and it is and outstanding gun, I shoot it very well and the Apex comp trigger is awesome. I just bought the M&P9c for carry and love it. I do not own any Glocks or XD's. I do own 2 M&P pistols and a M&P15T AR. Your mileage may differ.
To the OP, shoot all 3 and buy what feels right in your hand and shoots the best for you!!!!! COOP