writer = outputFactory.createXMLStreamWriter(stream,"UTF-8");
writer.writeStartDocument("utf-8", "1.0"); // Header
writer.writeStartElement("openkm"); // openkm node
for (Iterator<OKMDocumentBean> it = docList.iterator(); it.hasNext();) {
OKMDocumentBean doc = it.next();
writer.writeStartElement("document"); // document node
writer.writeStartElement("uuid"); // uuid
writer.writeCharacters(doc.getUUID());
writer.writeEndElement();
writer.writeStartElement("path"); // path
writer.writeCharacters(doc.getPath());
writer.writeEndElement();
writer.writeStartElement("localfilename"); // localfilename
writer.writeCharacters(doc.getLocalFilename());
writer.writeEndElement();
writer.writeStartElement("name"); // name
writer.writeCharacters(doc.getName());
writer.writeEndElement();
writer.writeEndElement(); // close document
}