but you didn't give much in the way of details. If it's an older system without regular care to prevent overheating...particularly of the CPU...that could be your problem. Telling more about the PC and the XP installation might help. XP is also funny about hardware changes and can exhibit just that symptom if too many hardware changes are detected.
I dont know what to do anymore I tried everything with my pc. Its running windows xp pro, and i have changed the RAM and the PSU. I formatted the hdd and checked for bad sectors and nothing was found. it still restarts most of the times. it goes through bios and then restarts. i have also changed the cmos battery and then it worked but i read on other forums that it cant be the cmos battery. so I dont know anymore

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic