private String serialize(Node node) throws IOException {
StringBuilder sb = new StringBuilder();
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node child = children.item(i);
new DefaultHtmlSerializer().serialize(child, sb);
}
return sb.toString();
}