Both guns are striker fired, and use polymer frames, so comparison should be easy. Both lines are offered in the popular pistol calibers of 9×19, .40, and .45 so you can get the one you want without compromising.
The industry press awarded the XD-45 the title of Handgun of the Year from both American Rifleman magazine and the The Shooting Industry Academy of Excellence. The XDM series of pistols won Handgun of the Year again in 2009. That means they must be doing something right. I've seen shooters using the .45auto version and loving it. Poly-framed guns are light, and .45 is no mild caliber, yet the shooters I met still enjoyed them. I think it is because the gun is very balanced.
Glock has a proven track record of reliability. They are really easy to clean, just 34 parts total. No positive safeties either, just a passive trigger safety. They are kind of like a double-action revolver that you can just draw and fire, so long as a round is chambered. This is why the police forces love Glocks so much. They operate reliably like their cherished revolvers, but have more capacity and a smaller down time for reloading.
Verily, the guns are so similar, you should decide based on what feels best for you. Which one fits your hands better, which one has a superior trigger pull, and which one has the better sight picture for your eyes. Check them both out.