# Extra content at the end of the document

Source: https://xmlvalid.com/errors/extra-content-at-the-end-of-the-document

> Something follows the root element, which must be the last thing in the document.

Example message: `Extra content at the end of the document`

## Why it happens

- Two root elements: an XML document has exactly one. Concatenated files or a list of records without a wrapper look like this.
- Text or a stray tag after the root's end tag.
- An end tag for the root that appears too early, so what follows is outside it.

## How to fix it

- Wrap several elements in one root element, or split the file into one document per root. Comments and processing instructions may follow the root; elements and text may not.

## Example that fails

```xml
<note/>
<note/>
```

## Fixed

```xml
<notes>
  <note/>
  <note/>
</notes>
```
