if (documentContentItem == null)
{
ContentLocation contentLocation = contentItems.getContentLocation();
NameGenerator contentNameGenerator = contentItems.getContentNameGenerator();
documentContentItem = contentLocation.createItem(contentNameGenerator.generateName(null, "text/html"));
this.writer = createWriterService(documentContentItem.getOutputStream());
xmlWriter = writer.getXmlWriter();
setDataWriter(this.contentItems.getDataLocation(), this.contentItems.getDataNameGenerator());