EntityReference entity = (EntityReference) node;
writer.getWriter().write("&");
writer.getWriter().write(entity.getNodeName());
writer.getWriter().write(";");
} else if (node instanceof Comment) {
Comment comment = (Comment) node;
writer.getWriter().write("<!-- ");
writer.getWriter().write(comment.getData());
writer.getWriter().write(" -->");
} else if (node instanceof DocumentFragment) {
DocumentFragment documentFragment = (DocumentFragment) node;
// Walk along the tree of nodes.
for (int i = 0; i < documentFragment.getChildNodes().getLength(); i++) {