Why it shows "You are opening the application 'Xcode' for the first time?
If you're not able to set the quarantine status on the app, then it will forever have that status and will prompt you. You can manually remove quarantine from the app with…

xattr -d com.apple.quarantine /Applications/Xcode.app