I am agree with Carlosdl. First u have to run virus scan. If the problem persists then boot in safe mode (if so), then try to login as Administrator and create a new user with password.
If this trick fails, u may repair XP with xp installation CD, cause when u run repair there is nothing to lost….. all are intact as it was earlier. But only REPAIR, not to FORMAT.
But for ur files/folders safety, it is better to take backup and if possible take registry backup also !
Hope it will help !