The xfj:output element specifies the output format and an optional document-level JavaScript (for PDF output only). This is specified using the xfj:javascript element:
<xfj:output>
<xfj:javascript>
app.alert("Hello DAL!");
</xfj:javascript>
</xfj:output>