What is the easiest way to wipe my hard drive,etc… and do a clean install of Windows XP ?

My computer is full of viruses and I downloaded avira and zonealarm but I still get trojans every time I start up. A friend told me that I should re-install windows xp and this would fix it, however when I try to UNinstall the xp that’s on there on safemode command prompt it will not let me because I don’t not have the "registry information." However, I believe this would be impossible to obtain seeing as I bought the IBM used! I clearly don’t know very much about this but is there any other way to uninstall windows xp or can I just install it over the old one (or would the damage stick? ) ?
I don’t care about saving old info I just want a clean computer!

Tips are much appreciated 🙂

My friends computer has become infected with spyware or a virus. He is running Windows XP on a Compaq. Theres a little dialog box popping up constantly that says theres a virus on the computer. When you click on the box it redirects you to a spyware remover page. Obviously its an attempt to sell this product. How can I remove this and stop all these pop ups? I was thinking about manually cleaning the registry. How would I go about that? And what about those programs in the Add/Remove programs in control panel that just wont go away? I need to get this junk off his computer. What do I do? Without spending money that is.

I’m using windows XP. My computer is running rather slow and I’ve done all the basic cleaning as well as scan disk and defrag and that hasn’t helped much. I’ve never cleaned my registry and I imagine there are quite a few mistakes in there although I don’t know what they are. I’m looking for a good free registry cleaner that will clean it and also fix the errors it finds.