GHOST has several options, but the most common one a disk image. That will
backup/restore the entire hard drive, with the exception of a few large
files that XP will automatically re-create, namely pagefile.sys and
hiberfil.sys. (You could backup those too, but there is no value, and they
can take up a few Gig.) A disk image also contains the master boot record,
so it can be restored to an unformatted hard drive, and still run XP. (In
contrast, a partition image would usually not save the boot record, and thus
would not run XP after a restoration to a new hard drive, directly, although
it could be used with a few more steps.)
As for product keys/activation, usually restoring either a disk or a
partition image will not invalidate those things, so long as the underlying
hardware (usually meaning the motherboard) has not changed. I have done
this several times with XP, Office 2003, etc.
However, activation will likely fail, if you restore to a new machine (new
motherboard), even if the same brand/model. This is to prevent someone from
buying one license fo XP, MS Office, etc, installing on one PC, then cloning
to other PCs. Note that pre-XP software is less sensitive about this sort
of thing.
If the whole machine dies, then first contact the PC maker for possible
warrantee replacement of hardware, and any software that came with the PC.
Even if post-warrantee, they may offer some deal. After that, try
installing the software and see what it does. But, in general you would
need to contact each software vendor to get activated. This could be as
simple as trading a several sets od numbers with a computerized voice, or it
might involve talking to a real person.
But, be aware, if you are using OEM-type software (e.g., XP came
pre-installed), then that license is non-transferrable to any other
hardware, even if the PC is destroyed. In contrast, retail linceses, at
least from Microsoft, are infinitely transferrable, although they may
eventually ask what you are doing if you call them too often.