Quick guess.... could be a problem with bad sectors on the hard drive. Typically, if you can complete an installation of WinXP, even slowly, you don't have a RAM problem.
How did you check your RAM? Something like MemTest? Start system in Safe Mode (hitting F8 when comp first boots up) then run
MemTest overnight. Check results in morning.
How did you check your PSU?
Aside from defective RAM, there are other potential culprits (or combination of things). You state there's dust built up inside of the case. How bad? Dust can cause electrostatic arcs across circuits. It can cause improper cooling of components. If your CPU, chipset or RAM aren't cooled properly, they can start to burn out causing all sorts of problems.
Was your system running slow when you bought it? Or just since you installed the new HDD?
Did you upgrade your CPU from the AMD Duron which typically shipped with that model system? If so, did the problems start at that time?
Is your BIOS up to date?
Check Here
When you check your BIOS, make sure the time & date are correct. If it seems to have reset to a much older year, such as 2000, then you may have a bad battery on your motherboard. Cheap & easy to replace.
What kind of peripherals are connected?
Try removing all extra PCI & AGP cards, ensure no printers or extra things are connected then boot system. Any better? I've seen defective devices cause all sorts of problems, including a bad DVD-RW drive which prevented the PSU from powering up or the motherboard from even posting.
With a 133MHz system bus speed, that computer will always be "slow" in today's environment (newer software = higher hardware demands, etc.) But 24 hours to install WinXP seems too long. What exactly constitutes 'installing' WinXP'?
Are you using the System Recovery discs that came with your Pavilion? How many discs are there?
If so, are those discs WinXP or WinME?
If WinME, are you attempting to use a WinXP Upgrade, or WinXP full retail (or OEM) version?
In that "24 hours" does the installation encompass only the original WinXP? Or does it include SP1 or SP2?
In that "24 hours" does the installation include downloading & installing all of the latest patches from Microsft? If so, what's your Internet connection speed?
Other than clear signs of fault, determining what is causing a computer to run slowly is typically one big process-of-elimination. Since your computer seems to have installed WinXP much too slowly, that's a better place to start than how it runs when WinXP is fully installed. It shows that there can be a hardware issue and/or an issue with how basic elements of WinXP recognizes and runs on the system.
If you have WinXP successfully installed on the system, check that the "IDE Channel" is set properly. To do this...
1. right-click on "My Computer"
2. select "Properties"
3. select the "Hardware" tab and then click on "Device Manager"
4. expand the "IDE ATA/ATAPI controllers" section
5. right-click on "Primiary IDE Channel" and select "Properties"
6. select the "Advanced Settings" tab and look at the "Transfer Mode:" for the devices
Both should be set to "DMA if available". If set to "PIO only", you've got a problem. Report back here for the solution.
And lastly for this reply, it is assumed that all of your wires & connections inside the case, including jumper settings for devices, are all installed properly. It's amazing how often I get customers who are ready to throw their systems into the trash and buy a new because they don't work anymore, only to have me reset a lose cable and turn their "broken piece of junk" into a fully functional system again.