Yes so long as it's XP home or XP Pro or any version that's the same as installed originally. You'll have to format and do a clean install. Before you do though I'd advise to use double driver to copy your machine's drivers. Ignore Windows drivers in that program as they will be installed anyway. click here
Remember to backup documents, music, browser favourites and any emails saved on your PC, and anything else you can think of.