I bought a G 34 (competition model 9 mm Glock) for my daughter as a college graduation gift. The first time we took it out, she was having a lot of failure to feeds but when I shot the gun, it worked flawlessly. The second time we shot it, she gripped the gun with more force and it was jam free for about 200rds.
Both the Glock and XD are good guns and I don't think you can go wrong with either gun. They have somewhat different ergonomics so trying them out side by side may help you to decide which gun to purchase. Good Luck.