You can simply copy Xcode to the other machine. There is a chance it will just work. Otherwise, when you try to launch the app it should ask you to sign in again, and if you sign in with an Apple ID that has already downloaded Xcode, you'll be good to go. (So your idea is right — you can start downloading it, then cancel and replace it with your own copy.)
More details: apps have the option to validate their receipt on launch. If the app is running on the wrong machine, it quits with an exit code of
This exit status notifies the system that your application has determined that its receipt is invalid. At this point, the system attempts to obtain a valid receipt and may prompt for the user’s iTunes credentials.
If the system successfully obtains a valid receipt, it relaunches the application. Otherwise, it displays an error message to the user, explaining the problem.
However, plenty of apps don't bother, and will launch without issue when moved to a different computer.