Your best bet would be to do a clean installation of the same version of Windows 7 that came on your x51. Download an ISO of the same version from
HERE, burn to a DVD, and do a custom install, the first step is to delete all existing partitions, then install to the remaining single unpartitioned space. Then load all the drivers from Dell
HERE -- download them and put them on a USB stick. Then re-activate your Windows with the activation key that is on the sticker on your computer. You can give the Windows disk to the new owner, it is a legitimate copy for that machine from Microsoft's online agent Digital River.