public Node toXml(Document doc) throws HttpException {
Element element = super.toXml(doc, "meter-payment-type");
element.setAttribute("code", code);
element.setAttribute("description", description);
MonadDate fromDate = new MonadDate(validFrom);
fromDate.setLabel("from");
element.appendChild(fromDate.toXml(doc));
if (validTo != null) {
MonadDate toDate = new MonadDate(validTo);
toDate.setLabel("to");
element.appendChild(toDate.toXml(doc));
}
return element;
}