// build xml
Document doc = XMLUtil.newDocument("Wampum");
Element payeesElement = XMLUtil.newChildElement(doc.getDocumentElement(), "Payees", null);
DAOFactory daoFactory = new DAOFactory();
PayeeDAO payeeDAO = (PayeeDAO)daoFactory.getDAO("payee");
List payees = payeeDAO.load("", "ORDER BY NAME", true);
Payee payee = null;
for (int i=0; i<payees.size(); i++) {
payee = (Payee)payees.get(i);
XMLUtil.appendChildNode(payeesElement, PayeeXML.createXMLDocument(payee).getDocumentElement());
}
Element accountsElement = XMLUtil.newChildElement(doc.getDocumentElement(), "Accounts", null);
AccountDAO accountDAO = (AccountDAO)daoFactory.getDAO("account");
List accounts = accountDAO.load(null, "ORDER BY TITLE", false);
Account account = null;
for (int i=0; i<accounts.size(); i++) {
account = (Account)accounts.get(i);
account.setAccountList(new ArrayList());
XMLUtil.appendChildNode(accountsElement, AccountXML.createXMLDocument(account).getDocumentElement());
}
Element transElement = XMLUtil.newChildElement(doc.getDocumentElement(), "Transactions", null);
TransactionDAO transDAO = (TransactionDAO)daoFactory.getDAO("transaction");
List transList = transDAO.load(null, null, false);
Transaction trans = null;
for (int i=0; i<transList.size(); i++) {
trans = (Transaction)transList.get(i);
List transSplitList = trans.getTransSplitList();