Has the CMOS battery ever been replaced? When bad, this can cause many issues.
You also want to make sure your computer on the inside is clean, RAM sticks snug, as well as cables. Use canned compressed air to blow out any dust (preferably outdoors). If it's quite old, sometimes the thermal paste on the CPU will dry out & cause the computer to shut down for safety. To remedy this, first obtain CPU thermal paste (I use & recommend Arctic MX-4), remove the CPU fan/heatsink (refer to your manual for instructions), clean it up good, using alcohol to clean the surface that contacts the CPU & then the CPU itself (removal not needed), making sure that all traces of the old are removed & then allow to dry.
Then place a drop or two of your new paste in the center of your cleaned & dried CPU & with something like a plastic card, spread it thinly across the CPU surface. Avoid getting any on the MB. It doesn't need to be a thick coating, just enough to cover the CPU fairly evenly. Then reinstall the heatsink/fan assembly, making sure to lock it down as was before removal & that the CPU fan wire if removed, is plugged back in.
Fire it up & see what happens. If XP boots & runs, this was likely the issue. If so, allow the computer to run awhile to cure the paste. Some brands, such as Arctic Silver Ceramique-2, requires up to 24 hours of running to fully cure.
Word of caution & safety: When working on the interior of a computer, first unplug the power & also the Ethernet cable, as it has some power, then press & hold the power button for 30 seconds to discharge any leftower power. To protect the sensitive components of the computer, wear a grounding wrist strap during all times that you're working inside of the case. Then remove the CMOS battery,
I bought a new hdd and loaded xp on it and it still acts the same.
By that, do you mean by clean install or from a system image or clone? If it was a clone, then any issues that was present on the other drive will simply transfer to the new & nothing will be fixed.