private Document document() throws HttpException {
Document doc = MonadUtils.newSourceDocument();
Element source = doc.getDocumentElement();
Element generationElement = (Element) toXml(
doc,
new XmlTree("siteSupplyGenerations", new XmlTree("site"))
.put("pc").put("mtc").put("cop").put("ssc")
.put("supply", new XmlTree("source").put("gspGroup"))
.put("mopContract", new XmlTree("party"))
.put("hhdcContract", new XmlTree("party")));
source.appendChild(generationElement);
for (Mpan mpan : mpans) {
Element mpanElement = (Element) mpan.toXml(doc, new XmlTree("core")
.put("llfc").put("supplierContract", new XmlTree("party")));
generationElement.appendChild(mpanElement);
}
source.appendChild(MonadDate.getMonthsXml(doc));
source.appendChild(MonadDate.getDaysXml(doc));
source.appendChild(MonadDate.getHoursXml(doc));