---
title: "Fragment"
source: https://dev.pageseeder.com/reference/glossary/fragment.html
description: "Fragments are the building blocks of PageSeeder documents. They can contain comments, have unique IDs, and be edited if the document format supports it. Specialized fragment types include properties, cross-references, and media fragments."
last_updated: 2026-09-14T13:54:40+10:00
tokens: ~391
---

# Fragment

[Documents](/reference/glossary/document.md) in PageSeeder are composed of fragments.

Fragments can have a [comment](/reference/glossary/comment.md) thread attached to them. If the document can be edited or is in an editable format such as [PSML](/reference/glossary/psml.md), its fragments can also be edited.

Fragments have unique identifiers (IDs) that are either generated by the system or can be assigned through markup.

Where [fragment IDs](/reference/glossary/fragment_id.md) are created through markup, fragments can be edited programmatically. This can be very useful where there is a need to update only specific parts of a document.

Fragments are grouped into [sections](/reference/glossary/section.md).

All documents have a default fragment, which is used to refer to the entire document.

## PSML

In PSML, fragments are usually represented using the `<fragment>` element. 

There are also specialized fragments:

- `<properties-fragment>` – for properties (simple data-value pairs).
- `<xref-fragment>` – for lists of [cross-references](/reference/glossary/cross_reference.md).
- `<media-fragment>` – for non-PSML content.

Fragments can be added, removed, or repositioned within the section or document, if in the [document template](/reference/glossary/document_template.md):

- The document structure isn’t set to [locked](/psml/elements/element_document.md).
- The [document](/psml/elements/element_document.md) or [sections](/psml/elements/element_section.md) aren’t set to be [read only](/reference/glossary/read_only.md).



