This is the most reliable way to reinstall the driver without an external download. I deleted XPS Document Writer! - Microsoft Q&A
: Viewing or printing older .xps files that are not natively compatible with modern PDF readers. How to Restore the Microsoft XPS Document Writer microsoft-xps-document-writer.zip (backup download)
Instead of downloading a risky .zip file from an unverified source, you can restore the official driver through Windows' built-in tools. 1. Use "Turn Windows Features On or Off" This is the most reliable way to reinstall
The Microsoft XPS Document Writer (MXDW) is a built-in virtual printer driver that allows you to create XML Paper Specification (.xps or .oxps) files from any Windows application that supports printing. While some users search for a backup download, this driver is natively included in Windows 10 and 11, meaning a third-party ZIP file is usually unnecessary and potentially unsafe. Why You Might Need a Backup Download How to Restore the Microsoft XPS Document Writer