You can specify an overlay using the xfj:overlay element. To place overlays on selected documents, it's recommended that you define an id attribute for each xfj:document.
Note: Document IDs are case-sensitive and will only work when placed on the xfj:document element.
Building upon our previous example, we will add the Overlay.fo document to display above all the documents in the job.

This will add a header to every document in the job, writing the current page number and total page count of the output document.
Notes:
| • | Overlays need the z-index attrbute to specify where they are to be positioned relative to the document contents and to other overlays. In this case, the overlay is above because the number is positive. |
| • | Overlays need a set of rules which tell the DAL engine where they should and shouldn't appear. In this case, the overlay will appear over all the documents. |
This is what the DAL job would look like:
<?xml version="1.0" encoding="utf-8"?>
<xfj:job xmlns:xfj="http://www.ecrion.com/xfj/1.0">
<xfj:output mime-type="application/pdf"/>
<xfj:overlay id="Header" z-index="1">
<xfj:apply-rules>
<xfj:match rule="all" />
</xfj:apply-rules>
<xfj:external-content src="url(Overlay.fo)" />
</xfj:overlay>
<xfj:document id="doc2" title="Current Superannuation">
<xfj:external-content src="InputPDF.pdf"/>
</xfj:document>
<xfj:document id="doc3" title="Your Funds">
<xfj:apply-local-template src="InputXFD.xfd"/>
<xfj:external-content src="data.xml"/>
</xfj:document>
</xfj:job>
All the files referenced can be found in the XML Samples folder.