I own a Glock 17, I had an XDM, and I've shot the M&P. With that said I definitely am keeping my Glock, I want an M&P, and I sold my XDM to my dad so I can shoot it whenever. It's a perfect combo.
The 17 is a great all around firearm. Standard capacity of 17+1 with the option of 19+1 and 31 or 33 +1. All factory mags and extensions. It's a nail driver. I love it.
The XDM was a great gun. The grip was a little slick for my taste, but that could be solved by a multitude of sleeves or tapes. It was a really fun gun that I am glad is close by.
The M&P's are great. I think the grip is also a little slick, but I'm a fan of really grippy guns. Again, there are many cheap ways to solve that problem. It's a really accurate firearm. Our State Patrol traded in their USP's for M&P's a few years ago. There has one been one "incident", but I can't disclose any info on that. It was what we call an operator error. I know a few Troopers and they love them. One has even purchased the compact, more CC friendly variant.
All in all, if I was doing it again (I just did this a few weeks ago), it would come down to the Glock 17 and the M&P. I decided to go with the Glock 17, but I am taking a serious look at the M&P full size .45's.