> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Function: normalizeLynxXmlArtifact()

> **normalizeLynxXmlArtifact**(`value`: `string`): `string`

Extract, normalize, and validate the document-level contract of a Lynx XML artifact.

Requires a closing Lynx root with an engine version, exactly one closed
main-thread script, and no CDATA sections. Does not execute code or validate
JavaScript, CSS, Element PAPI semantics, or rendering. Compile intermediate
Template or ScriptReuse documents before validating the final artifact.

## Parameters

| Parameter | Type     |
| --------- | -------- |
| `value`   | `string` |

## Returns

`string`

## Throws

Error when the document-level contract is invalid.

## Example

```ts
const source = normalizeLynxXmlArtifact(modelResponse);
// Pass the normalized source to the renderer.
```
