private static void printEntityRef(Writer out, EntityRef entity) throws IOException {
    out.write("&");
    out.write(entity.getName());
    out.write(";");
  }
private static void printEntityRef(Writer out, EntityRef entity)