Element resultNode = new Element("result");
resultNode.setAttribute("type", result.getOtype());
resultNode.setAttribute("id", result.getOid());
resultNode.setAttribute("title", result.getTitle());
if (result.getOtype().equals("action")) {
Action action = (Action)result.getObject();
resultNode.setAttribute("billno", action.getBill().getBillId());
}
else if (result.getOtype().equals("vote")) {
Vote vote = (Vote)result.getObject();
resultNode.setAttribute("billno", vote.getBill().getBillId());
resultNode.setAttribute("sponsor", vote.getBill().getSponsor().getFullname());