Corrosion-X, Eezox, or FP-10 are proven rust-preventive products. Personally, I've used Corrosion-X for 7+ years now and previous rust problems have not recurred.
I have an HS2000, the predecessor to the Springfield XD9, which rusted on the grasping grooves of the slide, similar to that of...