welcome to THR!
I can't help you with the s&w M&P because i haven't even held one ir seen one for that matter, in person. but it is a weapon from a very reputable company that makes wonderful weapons.
The xd's however i can lend you alot of first hand experience and knowledge.
1st thing to consider is the sa life time warranty, does s&w have the same? they might, but also right off the bat the xd comes with xd gear, three mags, holster, double mag carrier, loading tool etc, there aren't to many companies that do that for you.
my xd 4" service model .40 cal. I love it for one because it fits me, and it shoots great, i couldn't ask for a better weapon. it is reliable,and after over 3,000rds I have not had a single issue that was to the fault of the pistol, but to the reloads that I was shooting(undercharged rds) i have shot through it every kind of ammo, that is offered by the ammo companies, and lots of reloads to boot. everything from cone nose lead rds, round nose lead rds, fmj, jhp of every make and type, 155- 180gr bullet weights i have again never had a single issue with the gun at all. It is great, all around gun and i am positive that you would be happy with either, but when it comes to polymer handguns xd is the only way to go, and yes i have owned others. happy hunting, and please let us know what you decide, i hope this helps.