There shouldn't be much of a price difference between an XD and a M&P, so it will come down to personal preference.
The "feel" of the gun in your hand is VERY important. Both guns have very good "feel" in the hand, particularly if your hands are small or medium-sized. The M&P's 'adjustable' backstraps will help a lot if you've got medium-to-large hands.
I suspect that the XD will be slightly more accurate than the M&P. Both are service pistols, but I would give the nod to the XD for accuracy. I've owned both an XD9 and an XD40, and the only problem I had with either was the tip of the ejector breaking off in my XD40. The gun never malfunctioned with this condition, but getting a replacement part was a pain. (Kudos to Mr. Wolverine for intervening and getting the part for me

).
The M&P's seem to have an issue with their plastic box-based mags breaking, but the XD hard-plastic bases will break too if you continually drop them on the ground.
Do NOT judge the guns by 'snapping' the triggers in the gunshop. The only true test of a trigger is on the range firing the gun. The M&P's trigger will feel AWFUL dry-firing in the store, but it's actually not too bad at all on the range, and you will get used to it very quickly. The XD trigger is nicer and feels better (to me) than a Glock's with just a tad more reset, which is inconsequential if you're not shooting the XD in competition.
To sum up, you won't go wrong with either pistol.
