@Usiv Welcome to HP Community!
I understand that you are getting blue screen while installing the operating system.
Please perform the hard drive test and check.
1) Shutdown the computer.
2) Turn the computer back on again and repeatedly tap on the ESC until a Startup menu appears.
3) Press F2 once.
4) Go to Component test.
5) From the list, run the Hard Drive (extensive) test.
Windows XP support is stopped. I would suggets you go for windows 8 or Windows 10.
Keep us posted,
If you would like to thank us for our efforts to help you,
Give us a virtual high-five by clicking the 'Thumbs Up' icon below, followed by clicking on the "Accept as solution" on this post,
Have a great day!