I would truly hesitate to upgrade a system with a problem as you have described.
Much better if you are convinced you want to move up to Win 7 to backup your data, wipe the drive and start from scratch.
OR, backup your data, and wipe the drive and reinstall XP.
OR Backup your data, partition the drive into 2, and install both so you can dual boot.
Installing XP first. In some respects this is the best of both worlds.
What I wouldn't do is install a new OS on a system that was unstable, infected, or otherwise had issues.
Your just asking for more issues. If you have a problem, find it and fix it on the OS that you at least already know somewhat.