You guessed it - the Product Key printed on the machine is only valid for that copy of Windows that was pre-installed on it at the factory. That product key is now effectively 'dead' because it's not transferable to another machine or to another copy of Windows. That's the licence agreement between Microsoft, the PC manufacturer, and the original buyer of the PC.
It was rather unsporting and probably uneccessary of them to take Windows XP off it before giving you the PC. That Windows belongs to that PC for the lifetime of the PC, so by rights they could & should have left it on. All they needed to do was take all the confidential info off it, but I suppose that was too much trouble for them -- easier to wipe everything off - the rotten lot!
Now, borrowing your friends XP disc to install Windows on that PC is strictly illegal. You must buy a retail copy of XP of your own, complete with a licence and it's own product key. However, getting hold of a retail copy of XP now is going to prove difficult I think, unless you can find an independant "one off" little computer shop that builds computers to order - they will sometimes sell Windows on it's own with a licence & key, and have a network of suppliers who can still get hold of XP. Make sure they don't sell you an "upgrade" version as that will be no use to you. You need the full version.