.I just took my new XD 9 out to the range yesterday. I went through about 100 rounds. I have a very limited experience with handguns at the moment, which is why I got an XD!
Congrats! I bought my first handgun in May (an XD-9 Service), so I can very much relate to what you're experiencing. Fun, isn't it?
For some reason, I'm having a harder time shooting accurately at 18 yards. I have a few questions for everyone.
Does the gun need to be "broken" in to shoot accurately? (I was only using 9MM FMJ at the range)
No. The trigger will smooth out as you shoot more (say, 500 rounds or so), but you can accelerate this process by doing dry-fire drills.
Could it be that I just need more experience with the new firearm?
Quite possible. If this is your first one, you're quite possibly jerking the trigger, having trouble with sight target, maybe have grip issues, there's a host of things that might be needing improvement. 18 yards is not an easy distance. As others suggested for me, start at 7 yards and when you can nail that consistently and well, then move out to 15 yards or further.
Does accuracy change that much with different types of ammo?
Not that much. There have been some lots which inexplicably seem to shoot worse, but not horribly so. Since you're new (we all were at one time!), I'd focus more on trigger control and sight picture and breathing to start. Stance and grip also. And work at the shorter distance to gain good control.
If there's any way you can get a lesson from a certified instructor, try to do it. He/she will correct your grip and stance as necessary, watch your technique, etc. etc. If you can, you want to avoid developing bad habits that will take 4 times as long to break as it did to develop them.
Congrats again, and enjoy!