# PEPPOL-EN16931-R008

Source: https://xmlvalid.com/rules/PEPPOL-EN16931-R008

> Document MUST not contain empty elements.

- Level: error
- Rule sets: Peppol BIS Billing 3.0 rules 3.0.21
- Context: `//*[not(*) and not(normalize-space())]`
- Test: `false()`

> Document MUST not contain empty elements.

- Level: error
- Rule sets: XRechnung 3.0 rules (UBL) 2.6.0
- Context: `//*[not(*) and not(normalize-space())]`
- Test: `self::cbc:ID[parent::cac:OrderReference]`

> Document MUST not contain empty elements.

- Level: error
- Rule sets: XRechnung 3.0 rules (CII) 2.6.0
- Context: `//*[not(name() = 'ram:ApplicableHeaderTradeDelivery') and not(*) and not(normalize-space())]`
- Test: `false()`

> Document MUST not contain empty elements. (still status warning)

- Level: warning
- Rule sets: Factur-X EN 16931 rules 1.09.2, Factur-X EXTENDED rules 1.09.2
- Context: `//*[not(*) and not(normalize-space())]`
- Test: `false`

## Why it fails

- An element is present but empty, such as `<cbc:Note/>` or `<cbc:Note> </cbc:Note>`. Generators often write optional fields even when they have no value.

## How to fix it

- Leave out elements that have no value instead of writing them empty. The line of the finding points at the empty element.

Validate a document against these rules: https://xmlvalid.com/validate
