JSONArray json = JSONArray.fromObject(childNode.toArray()); String s = json.toString(); response.setContentType("text/json; charset=UTF-8"); response.setCharacterEncoding("UTF-8"); try { response.getWriter().write(s); } catch (IOException e) { e.printStackTrace(); }