If you encounter connection issues while trying to AirPlay, try the following:
Make sure your iPhone/iPad and Xbox One are on the same Wi-Fi network.
Ensure your Xbox One firmware and Apple device are updated to the latest version.
Restart your iPhone/iPad and Xbox One.