
# How do I create an XML output for a page?

> Add a non-publishable XML Output to a Configuration so you can view the system-generated XML for any page using it.

URL: https://www.hannonhill.com/cascadecms/latest/articles/developing-in-cascade/script-formats/create-xml-output-for-a-page.html
category: Developing in Cascade
article-type: how-to
content-kind: faq
release-availability: all
tags: templates, velocity
updated: 2026-10-06

An XML Output gives you a way to see the system-generated XML behind a page — invaluable when writing or debugging a Format.

1. Create a new Template containing only `<​system-region name="DEFAULT"/>`.
1. Navigate to **Manage Site** > **Configuration**.
1. Select your existing Configuration and edit it.
1. Click **Add new Output**.
1. For **Name**, enter "XML".
1. For **Template**, browse to the Template from step 1.
1. For **File Extension**, enter ".xml".
1. For **Type of Data**, select "XML".
1. Leave **Publishable** unchecked for now.
1. Click **Submit**.

Now navigate to a page using that Configuration, click the **Output** drop-down, and select "XML" to see the generated XML.

## If you see a "Root element not set" error

```bash
Could not convert JDOM document into string: Exception outputting Document: Root element not set
```

Change the Template content from:

```html
<​system-region name="DEFAULT"/>
```

to:

```html
<xml>
    <​system-region name="DEFAULT"/>
</xml>
```

This ensures the content within the DEFAULT region always has a root element.

## Context-sensitive Index Blocks

The XML configuration's DEFAULT region is a useful place to plug in context-sensitive Index Blocks. An Index Block with **Rendering Behavior** set to "Start at the current page..." only generates XML once it's attached to a page region. To see its output for a given page:

1. Click **Edit** on the page.
1. Click the **Configure** pane.
1. Click the XML Configuration.
1. In the DEFAULT region, use the Block chooser to select the Index Block.
1. Click **Submit**.

Return to the page view and select the XML output to see the XML the Index Block generates for that page.
