} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage());
}
}
public void writeTo(OutputStream out) throws IOException {
CommentsDocument doc = CommentsDocument.Factory.newInstance();
doc.setComments(comments);
doc.save(out, DEFAULT_XML_OPTIONS);
}