If you cant find the XP cd key, eg. abcde-asdfsas-asfdfas-asdasdf-asdfasdf then call microsoft they will give you another one.
However if you mean you lost the password for logging on - then it could be a bit harder. Try logging on as guest or as administrator. Or using a second os or live linux cd, access your files, find the registry files, (something.sam) then run a program called lophtcrack. but imo if you can access the files from say, dos then theres no point trying to fix the installation, just reinstall.