I would go with the XDm, in large part because I already have an XDm. I would not rate the trigger on the XDm as being at all "lousy", in fact it's fairly good with a 5.5 lbs. break. Yeah, there is about 1/16 inch of sear creep but that's rather easy to adapt to with simple practice and creeepy triggers are pretty darned common with most striker fired tupperware pistols. There are also trigger kits available for those who desire a lighter and crisper trigger. On the plus side the reset of the trigger is short and I found it easy to feel.
Other positives for the XDm are sights that are IMO very very good, multiple levels of safeties that don't intrude on the shooter, and a takedown procedure that doesn't require dry firing the pistol. Some may hate that grip safety but I've NEVER had any problem activating it and it does provide another layer of safety when holstering your pistol as long as you use the rear of the slide to thumb the pistol into a holster. So, no "Glock leg" with the XDm. As for the trigger on the M&P series, I LOATHE this STUPID trigger and it's why I won't purchase a M&P. Partly because I have narrow fingers and have found the trigger locked out when I was too high on the trigger when I was test driving for my first polymer. Glock's patent on their trigger has expired so IMO S&W should simply copy it as was done with the XDm. It works about as expected without intruding on the shooter or requiring shooter to pay special attention to finger placement. BTW, my XDm is my only pistol with a trigger safety and I find these devices rather useless, however they are apparently an absolute requirement for a Law Enforcement firearm even if they don't really prevent or do anything.