First boot using windows 98 Setup CD, if u don't hv then create a bootable floppy in Windows 98 and boot using it.
And when u'll boot using CD or floppy, u'll enter into DOS mode, then type following command:
format C:\ and then press
y, it'll format ur C: drive.
Do same for D: drive also:
format D:\ and press
y.
Now goto folder, in which ur 98 Setup files r stored and type:
Setup
Now follow the steps and windows 98 will be installed
Now again boot using windows XP CD and install it on D: drive.