Entry nextEntry = iterator.next();
Element tr,td;
doc.insertBeforeEnd(table, "<tr/>");
tr = table.getElement(table.getElementCount() -1);
//doc.insertBeforeEnd(tr, "<td><![CDATA[" + nextEntry.getKey() + "]]></td><td><![CDATA["+nextEntry.getValue() + "]]></td>");
doc.insertBeforeEnd(tr, "<td>" + nextEntry.getKey() + "</td><td>"+nextEntry.getValue() + "</td>"); //todo use text node (there may be markup in the entry)
}
HashMap result = new HashMap();
result.put(HTML.Tag.HTML, doc);