"If I don't press anything it just keeps restarting" Could be a loose cable connection or the ram sticks, graphic card etc working loose. Take side off and reseat everything (remove and put back) and you might as well clean out the dust and fluff that accumulates.
Once you've got it booting okay - If you tell us the make and model of the pc it may be that there is a 'Restore to factory fresh' option and/or an option to make your own dvds to reinstall. Have a look in: Rightclick My Computer, Manage, Disk Management, and see if there is a restore partition still there (it might have got deleted sometime in the past).
Also look in Windows Explorer at the C: drive for a folder called i386 as that is XP and can be used as well (with a bit of tweaking)
Let us know which or any of the above you have.