Add the xps2pdf.sh contents to your bashrc file. If you don't know what that means, then run the following:
curl -fsSL https://gist.githubusercontent.com/balupton/7f15f6627d90426f12b24a12a4ac5975/raw/xps2pdf.sh | bashUse like so:
# Convert a particular xps file
xps2pdf thefile.xps
# Convert all xps files in the current working directory
xps2pdf *.xpsIt will create the pdf files with the same creation time as the original xps files.
Thanks to Sriram Thaiyar for the original ruby version which figures out GhostPDL can be used for the conversion, which is the crux of the operation.