The Xbox One X offers output at up to 4K resolutions (3840 x 2160).
The Xbox One X also offers HDR color output as an option.
Most Elgato Gaming Devices Can't Use 4K video
Most Elgato Gaming devices cannot passthrough, capture or stream 4K video. For those devices, you must set your Xbox One X to 1080p output, or less.
The only Elgato Game Capture devices that can capture 4K video are:
Elgato Game Capture 4K60 Pro
Elgato Game Capture 4K60 Pro Mk.2
Most Elgato Gaming Devices Can't Use HDR Colors
If you want to use the Xbox One X with most Elgato Gaming devices, you must turn HDR off.
However, the Elgato Game Capture 4K60 Pro Mk.2 is able to capture HDR.
More information on recording HDR can be found here:
Elgato Game Capture 4K60 Pro MK.2 – Recording HDR gameplay with 4K Capture Utility
The older Elgato Game Capture 4K60 Pro can passthrough HDR colors but cannot capture them. See this article for more details:
HDR Video is Supported with New Hardware and Software
For more information about the Xbox One X and HDR, please see this article from Xbox.com:
Troubleshooting 4K and HDR on Xbox One X and Xbox One S