Excellent Microsoft KB articles which explains how to integrate Service Pack 2 with Windows XP. This process is known as Slipstreaming.

Reinstalling Windows XP is time-consuming, especially when you have to update your computer by using Windows Update. However, there is a simpler procedure that you can use. In just a few steps, you can combine Windows XP and Service Pack 2 (SP2) so that you can burn them on a single repair disc. This guide provides step-by-step instructions on how to do this. You will need:

Combining Windows XP with Service Pack 2 for reinstallation (Part 1: Introduction)

Combining Windows XP with Service Pack 2 for reinstallation (Part 2: Copying the Windows CD to the hard disk)

Combining Windows XP with Service Pack 2 for reinstallation (Part 3: Integrating Service Pack 2 in the Setup files)

Combining Windows XP with Service Pack 2 for reinstallation (Part 4: Reading the boot image file)