first of all when kotuday said he has the cd key, there is no need to tell him ways how to retreive his cd key.
The second problem your cd key is not working.
As most of us know XP comes in three packages.
1. OEM (Original Equipment Manufacturer)
2. Retail
3. VLK (Corporate)
Despite, their same beahviour, the product keys (cd keys) are not exchangeable. ie; you can't use an oem or retail version key for corporate version.
As u r saying u have legal windows, it should either be oem or retail. and if it was bundled with ur branded pc, it is oem, else it wud be retail. Other way to find if you have oem version is right click My computer. Select properties. Here, in the Registered to section in the general tab, check your product key. (Actually this is the product key, and
xxxxx-xxxxx-xxxxx-xxxxx-xxxxx is the cd key).
In this key, if you find ur product key something like xxxx-OEM-xxxxxxx-xxxxx, u r using oem version. I can't give ne hints here for retail version. Sorry for that.
Individuals dont buy corporate versions.
But if ur friend is using a pirated version, 99% chances are he is using a corporate version of XP. and ur key is either for oem or retail version and it is definitely not going to work. So, u will have to borrow a cd from such a friend who has the same version (oem for oem or retail for retail). i am not sure whether oem verin and retail version keys can be used interchangeably. U can give it a try.
And if you want a replacement, you can try contacting Microsoft. No idea whether they will issue u a replacement or not. But no harm in giving it a try. And if you got the cd with a branded pc, you can try contacting your hardware store if they can help. They wont give u original copy. But can manage to make a copy for you.
Hope this help you