Hi,
Unless you have deleted the Recovery partition on your machine, otherwise your machine should have a Recovery partition. Make sure backing up all of your files before restoring the PC/laptop to factory settings.
To set your PC/laptop to factory settings, restart the PC/laptop. At the HP welcome screen hit repeatly the F11 key (or Esc key) to launch the recovery process. Follow the instructions provided on the screen.
Please also check this:
http://h50146.www5.hp.com/lib/doc/manual/workstation/xw8400/HP_Backup_and_Recovery_Manager_User_Guide.pdf
Regards,
ps We cánt format the Operating System. It's a software and we don't format software.