@SuppressWarnings("unchecked")
protected Document document() throws HttpException {
Document doc = MonadUtils.newSourceDocument();
Element source = doc.getDocumentElement();
source.appendChild(toXml(doc, new XmlTree("party", new XmlTree(
"participant"))));
for (Party party : (List<Party>) Hiber
.session()
.createQuery(
"from Party party where party.role.code = :roleCode order by party.participant.code")
.setCharacter("roleCode", MarketRole.MOP).list()) {
source.appendChild(party.toXml(doc, new XmlTree("participant")));
}
source.appendChild(new MonadDate().toXml(doc));
source.appendChild(MonadDate.getMonthsXml(doc));
source.appendChild(MonadDate.getDaysXml(doc));
return doc;