yes
You can do it easily.
In Simple Language here are the steps.
Take off both sides of your case. Normally there are screws on the back of the case. Sometimes they can be hidden by a removable panel on the front though.
Find your cd drive, it is held in place by 4 screws normally.
Remove those screws, pull the 2-3 connectors out of the back of the cd drive.
Insert DVD drive, plugging in wires exactly where they were on cd drive, if its a thin one with a black or white connector that came from the cd drive doesn't fit in the dvd drive then dont' worry, its just the audio for cds, XP doesn't even need it.
Replace the screws.
Replace the side panels of the case
Boot up computer.
Enjoy.
Edit: Oh I forgot, Check the jumpers on the new DVD drive. You need to set it to Master. You will see a plastic thing covering 2 pins on the back of the drive. Normally there is a diagram on the drive showing you where the jumpers go for certain settings, Typically MA is master SL is Slave and CS is Cable Select. Put the plastic thing over the 2 that correspond to MA. It is likely on that one or CS initially.
You can actually leave it on CS if its on that one, but I myself have never used any drives on CS.