I owned an XD-M .40 for about six weeks. I purchased one of the very first batch released. It was a nice weapon, but was rather on the LARGE size for me. It was accurate and for the few rounds I shot through it, it was reliable. Just wasn't my "cup of tea."
Prior to the release of the P30 I was not a huge HK fan. The USP is simply too "blocky" for me. Since purchasing my first P30, my shooting life took a turn towards HK. I cannot compliment HK enough on this pistol. I now own 2 P30 9mm, 2 P30S .40, and 2 P30L 9mm. Yes, I like the platform. The P30L is my USPSA/IDPA gun, the P30S .40 is my duty platform, and the P30 9mm is my everything else handgun.
Given a choice between the two, it all depends upon your intended use and how much you are willing to spend on a handgun. Don't buy into the hype that the HK magazines are all that expensive, they are not. I can get P30 magazines for $31.00 a piece and the XD-M magazines are similarly priced. The price difference between pistols will be an estimated $200 higher for the P30 if you shop around.
Best of luck.