Fragments are small portions of documents that are stored in XML files separate from your primary documents so that they can be reused. For example, if you are creating several pieces of curriculum for a course fragments give you the ability to share scripts, footers, or even equations between documents.

The main structure of a fragment includes two primary elements. The first portion of a fragment is the documentation itself, which lives in an XML file that's separate from your primary document. The actual XML code that defines the fragment must be included inside a fragment element instead of a document element. Fragments can include all content types that could be placed into a standard <section> or <sectionNoTitle>. For example, the following fragment includes a paragraph.

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns="http://resources.qdexapps.com/schema/v1/QDocument.xsd">
    <p>This paragraph lives in a fragment.</p>

To include this fragment in a document, all you have to do is add an include element into your document where appropriate, and specify the name of the fragment. For example, if the fragment is in an XML file called "fragment.xml" then you would include it in your main document, using the following element:

<include src="fragment.xml"/>