How do I change my Apple ID in macOS? (no Apple ID login)
The easiest is simply to uninstall Xcode, log out of the App Store with your AppleID, login again with a new AppleID - and simply reinstall Xcode.

If you do not have an AppleID, you can create a new one. Xcode is a free download.