I started adding an XPC Service  by using XCode's built-in functionality.
At this point, I consulted the excellent blog post  by Matthew Miner, in which the process of converting the boilerplate  Objective-C code into Swift is described. Interested readers should consult the original source, but the steps are repeated here.
- Rename files:
main.m -> main.swift
CPU_Temp_XPC.h -> CPU_Temp_XPC.swift
CPU_Temp_XPC.m -> CPU_Temp_XPC_Delegate.swift
CPU_Temp_XPCProtocol.h -> CPU_Temp_XPCProtocol.swift
- Add the files to the target's "Compile Sources" build phase.
Replace the Objective-C contents with Swift translations and edit build settings:
- Install Objective-C Compatibility Header: NO
- Objective-C Generated Interface Header Name: “”
- Runpath Search Paths: @loader_path/../../../../Frameworks
- Swift Language Version: Swift 5
- Add testing logic 
- NOTE - the NSXPCConnection used for testing must use the target's bundle identifier
- This commit adds a class, XPC_Tester, and some front-end logic to test that the XPC Service is configured properly. The test class conforms to the ObservableObject protocol and publishes a variable for tracking by the front-end. The front-end in turn calls the tester to convert an input String to uppercase using the XPC Service.