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

# Function: generateMainThreadScript()

> **generateMainThreadScript**(`xmlFragment`: `string`): `string`

把 XML 元素片段转换为供 renderPage() 使用的 Element PAPI 调用。

## Parameters

| Parameter     | Type     |
| ------------- | -------- |
| `xmlFragment` | `string` |

## Returns

`string`
