doc.appendChild(serializable.toXml(doc));
OutputFormat format = new OutputFormat("xml", "UTF-8", false);
XMLSerializer serializer = new XMLSerializer(out, format);
serializer.setNamespaces(true);
serializer.asDOMSerializer().serialize(doc);
byte[] bytes = out.toByteArray();
httpResponse.setContentType("text/xml; charset=UTF-8");
httpResponse.setContentLength(bytes.length);
httpResponse.getOutputStream().write(bytes);