# Form data

## Introduction

Form Runner loads and saves data in XML format. This page describes the format used.

## Basics

As you create a form definition with Form Builder, an XML representation for the data to capture is automatically created. It is organized as follows:

* A root element:

  &#x20; `<form>`
* Within that element, for each section, a sub-element named after the section name:

  &#x20; `<address>`
* Within a section element, a sub-element for each control in the section, named after the control name:

  &#x20; `<first-name>`
* Within each control element, the value of the control is stored:

  &#x20; `<first-name>Alice</first-name>`

Example:

```markup
<form>
    <details>
        <title/>
        <author/>
        <language/>
        <link/>
        <rating/>
        <publication-year/>
        <review/>
        <image filename="" mediatype="" size=""/>
    </details>
    <notes>
        <note/>
    </notes>
</form>
```

## Nested sections

TODO

## Repeated grids and sections

TODO: Specify how nested grids and nested sections are represented.

*NOTE: Non-repeated grids do not create containing elements.*

## Attachments

For attachments, the control element is slightly different:

* the text content is a URL pointing to the location of the attachment in the persistence layer
* attributes are used for storing
  * the file name
  * the file media type
  * the file size

Example:

```markup
<my-attachment filename="book.png" mediatype="image/png" size="13245">
/fr/service/exist/crud/orbeon/builder/data/5277.../book.png
</my-attachment>
```

## See also

* [Form Definition Format](https://doc.orbeon.com/~/revisions/-LFrzxlvP9UXA6_RDYI9/form-runner/apis/data-formats/form-definition)
