Pc will not install windows

A friend of mine was having trouble with her pc. It would not boot at all, it kept freezing on starting on a black screen.
She fetched it to me with her disks and I had a look. I could not get into safe mode or even the bios. So I decided that it would have to be a re-install from scratch.
The o/s is win xp home edition, I placed the cd in the drive and started the pc, all files were being copied as usual, I did a full ntfs format and began the installation. When it got to the ‘restarting the pc’ it restarted with the xp logo and the ‘blue bar’ working (you know what I mean) then instead of finishing the installation, a light blue screen appeared with the message ‘setup is restarting’ and went into a loop. This happens over and over again… I am very stuck

Any help please?

Thankyou

Start by checking the RAM. Download Memtest86, create a floppy or CD, boot to that and let it run overnight. If there’s any errors at all, replace the RAM or swap the sticks out to find the bad stick.

Also download the diagnostic tools for the hard drive, from the drive’s maker, and run them from a floppy/CD as well. Check the drive thoroughly, then use the same utility to wipe the drive clean.

Memory will cause that on other OSs too. I was trying to setup Suse Enterprise Linux and could not, but the DVD had the memory test program suggested by CDan so it was easy to run. Then I encountered the same problem on 2 Windows XP Pro machines, one a new build and the one I was using started messing up. Sometimes you can re move the memory, clean the contacts with a liquid electrical cleaner, and then reseat it. Most name brand memory companies will replace their memory for life.