Example 1 — Feature Detect xmlVersion
Many modern engines omit this deprecated property entirely.
const supported = "xmlVersion" in document;
console.log(supported);
if (supported) {
console.log(document.xmlVersion);
} else {
console.log("xmlVersion not available");
} How It Works
- Use
in. Safer than reading a removed property. - Expect gaps. Firefox removed it long ago; others may omit it too.
- Do not polyfill. There is nothing useful to restore.
- Migrate intent. Use the HTML-mode check instead.

