I personally don't like the XD grips, they get slipper with a little bit of sweat IMO due to not being very textured, pretty high bore axis too for a striker fired pistol. In comparison I feel the m&p is a much better all around pistol. The xd's trigger stock is better than the m&p's imo, but after about 500 rounds the m&p trigger will smooth out, and if you still don't like it you can get apex goodies for it. The grip safety on the XD is a nice feature, but you do have the option of getting the manual safety on the m&p - apples and oranges, but just some thoughts.
If it was me, it would be the m&p no hesitation.