I have shot the M&P and found it to be accurate and comfortable in the hand. The standard 3 dot sights were ok but I remember thinking if it were my pistol I would change them out. Trigger was ok and pretty standard for a combat pistol. XDM line comes with a match barrel and trigger which I find to be very nice on my XDM 45, so much so that I am planning on buying a XDM 9mm in the near future.
My experience with the XDM is in 45 but I have been very pleased with the quality, trigger is good right out of the box. I was not a big fan of the grip safety and prior to owning one was not interested in this feature. Now that I own one I can say the grip safety does not bother me at all, it is very light to depress and certainly not a factor when being shot, you don't even notice it while shooting. The sights on the XDM are 3 dot but have horizontal groozes like a target sight and present a excellent sight picture as they are.
Both pistols are keepers, I would recommend the XDM with stainless slide over the M&P. To me the XDM line has some great safety features. With the striker condition indicator and loaded chamber idicator you know the condition of the pistol at a glance. Someone else mentioned the Glock 17 which I also prefer over the M&P; with a ghost ultimate trigger my Glock is my go to gun but the XDM is attempting to take that postion. I'm willing to bet over time you will pick up them all.