> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# renderXml

> Render the entire model as an XML document.

[ref-rendermarkdown]: /docs/server-sdks/reference/typescript/agents/pom-object-model/render-markdown

Render all top-level sections as a single XML document wrapped in a `<prompt>`
root element. Each section becomes a nested `<section>` element with its title,
body, and bullets rendered as child elements.

The Markdown variant -- [`renderMarkdown()`][ref-rendermarkdown] -- is the
default render format. Use `renderXml()` only when the downstream LLM or
template expects XML-structured input.

## **Parameters**

None.

## **Returns**

`string` -- XML document starting with `<?xml version="1.0" encoding="UTF-8"?>`
and wrapping all sections in a `<prompt>` root.

## **Example**

```typescript {6}
import { PromptObjectModel } from '@signalwire/sdk';

const pom = new PromptObjectModel();
pom.addSection('Intro', { body: 'Welcome.' });
pom.addSection('Rules', { bullets: ['Be nice.', 'Stay on topic.'] });
console.log(pom.renderXml());
// <?xml version="1.0" encoding="UTF-8"?>
// <prompt>
//   <section>
//     <title>Intro</title>
//     <body>Welcome.</body>
//   </section>
//   ...
// </prompt>
```