Example usage for javax.xml.stream XMLStreamWriter writeStartDocument

List of usage examples for javax.xml.stream XMLStreamWriter writeStartDocument

Introduction

In this page you can find the example usage for javax.xml.stream XMLStreamWriter writeStartDocument.

Prototype

public void writeStartDocument(String encoding, String version) throws XMLStreamException;

Source Link

Document

Write the XML Declaration.

Usage

From source file:org.flowable.cmmn.converter.export.DefinitionsRootExport.java

public static void writeRootElement(CmmnModel model, XMLStreamWriter xtw, String encoding) throws Exception {
    xtw.writeStartDocument(encoding, "1.0");

    // start definitions root element
    xtw.writeStartElement(ELEMENT_DEFINITIONS);
    xtw.setDefaultNamespace(CMMN_NAMESPACE);
    xtw.writeDefaultNamespace(CMMN_NAMESPACE);
    xtw.writeNamespace(XSI_PREFIX, XSI_NAMESPACE);
    xtw.writeNamespace(FLOWABLE_EXTENSIONS_PREFIX, FLOWABLE_EXTENSIONS_NAMESPACE);
    xtw.writeNamespace(CMMNDI_PREFIX, CMMNDI_NAMESPACE);
    xtw.writeNamespace(OMGDC_PREFIX, OMGDC_NAMESPACE);
    xtw.writeNamespace(OMGDI_PREFIX, OMGDI_NAMESPACE);
    for (String prefix : model.getNamespaces().keySet()) {
        if (!defaultNamespaces.contains(prefix) && StringUtils.isNotEmpty(prefix))
            xtw.writeNamespace(prefix, model.getNamespaces().get(prefix));
    }/*from   ww  w  . ja  v a 2  s .  c o  m*/
    if (StringUtils.isNotEmpty(model.getTargetNamespace())) {
        xtw.writeAttribute(ATTRIBUTE_TARGET_NAMESPACE, model.getTargetNamespace());
    } else {
        xtw.writeAttribute(ATTRIBUTE_TARGET_NAMESPACE, CASE_NAMESPACE);
    }
}

From source file:org.gatein.management.rest.FailureResponse.java

private void writeXml(OutputStream out, boolean pretty) throws IOException {
    XMLStreamWriter writer;
    try {// www  .  jav a 2 s  . co m
        writer = XMLOutputFactory.newInstance().createXMLStreamWriter(out);
    } catch (XMLStreamException e) {
        throw new IOException("Could not create XML streaming writer.", e);
    }

    try {
        writer.writeStartDocument("UTF-8", "1.0");
        // root element <failureResult>
        nl(writer, pretty);
        writer.writeStartElement("failureResult");
        nl(writer, pretty);
        indent(writer, 1, pretty);

        // <failure>
        writer.writeStartElement("failure");
        writer.writeCharacters(outcome.getFailureDescription());
        writer.writeEndElement();
        nl(writer, pretty);
        indent(writer, 1, pretty);

        // <operationName>
        writer.writeStartElement("operationName");
        writer.writeCharacters(operationName);
        writer.writeEndElement();
        nl(writer, pretty);

        // </failureResult>
        writer.writeEndElement();

        // End document
        writer.writeCharacters("\n");
        writer.writeEndDocument();
        writer.flush();
    } catch (XMLStreamException e) {
        throw new IOException("Exception writing failure response to XML. Failure response message was '"
                + outcome.getFailureDescription() + "'", e);
    }
    //      finally
    //      {
    //         try
    //         {
    //            writer.close();
    //         }
    //         catch (XMLStreamException e)
    //         {
    //            // ignore
    //         }
    //      }
}

From source file:org.gluewine.trace.XMLTracer.java

/**
 * Returns the writer associated with the current thread. If none exists, one is
 * created.//from ww w  . j  a  v  a 2 s . co m
 *
 * @return The writer to use.
 */
private XMLStreamWriter getWriter() {
    XMLStreamWriter writer = writers.get(Thread.currentThread());

    if (writer == null) {
        try {
            writer = xof.createXMLStreamWriter(
                    new FileWriterWithEncoding(file + "_" + Thread.currentThread().getId() + ".xml", "utf8"));
            writer.writeStartDocument("utf-8", "1.0");
            writer.writeStartElement("trace");
            writer.writeAttribute("thread", Long.toString(Thread.currentThread().getId()));
            writers.put(Thread.currentThread(), writer);
        } catch (Throwable e) {
            ErrorLogger.log(getClass(), e);
        }
    }

    return writer;
}

From source file:org.gtdfree.model.GTDDataXMLTools.java

static public void store(GTDModel model, OutputStream out, ActionFilter filter)
        throws IOException, XMLStreamException, FactoryConfigurationError {

    if (filter == null) {
        filter = new DummyFilter(true);
    }/*  ww  w.java 2 s. co  m*/
    XMLStreamWriter w = XMLOutputFactory.newInstance().createXMLStreamWriter(out, "UTF-8"); //$NON-NLS-1$

    w.writeStartDocument("UTF-8", "1.0"); //$NON-NLS-1$ //$NON-NLS-2$

    w.writeCharacters(EOL);
    w.writeCharacters(EOL);

    w.writeStartElement("gtd-data"); //$NON-NLS-1$
    w.writeAttribute("version", "2.2"); //$NON-NLS-1$ //$NON-NLS-2$
    w.writeAttribute("modified", ApplicationHelper.formatLongISO(new Date())); //$NON-NLS-1$
    w.writeAttribute("lastActionID", Integer.toString(model.getLastActionID())); //$NON-NLS-1$
    w.writeCharacters(EOL);
    w.writeCharacters(EOL);

    // Write folders

    Folder[] fn = model.toFoldersArray();
    w.writeStartElement("lists"); //$NON-NLS-1$
    w.writeCharacters(EOL);

    for (int i = 0; i < fn.length; i++) {
        Folder ff = fn[i];
        if (ff.isMeta() || !filter.isAcceptable(ff, null)) {
            continue;
        }
        w.writeCharacters(SKIP);
        w.writeStartElement("list"); //$NON-NLS-1$
        w.writeAttribute("id", String.valueOf(ff.getId())); //$NON-NLS-1$
        w.writeAttribute("name", ff.getName()); //$NON-NLS-1$
        w.writeAttribute("type", ff.getType().toString()); //$NON-NLS-1$
        w.writeAttribute("closed", Boolean.toString(ff.isClosed())); //$NON-NLS-1$
        if (ff.getCreated() != null)
            w.writeAttribute("created", Long.toString(ff.getCreated().getTime())); //$NON-NLS-1$
        if (ff.getModified() != null)
            w.writeAttribute("modified", Long.toString(ff.getModified().getTime())); //$NON-NLS-1$
        if (ff.getResolved() != null)
            w.writeAttribute("resolved", Long.toString(ff.getResolved().getTime())); //$NON-NLS-1$
        if (!ff.isInBucket() && ff.getDescription() != null) {
            w.writeAttribute("description", ApplicationHelper.escapeControls(ff.getDescription())); //$NON-NLS-1$
        }
        w.writeCharacters(EOL);

        for (Action a : ff) {

            if (!filter.isAcceptable(ff, a)) {
                continue;
            }

            w.writeCharacters(SKIPSKIP);
            w.writeStartElement("action"); //$NON-NLS-1$
            w.writeAttribute("id", Integer.toString(a.getId())); //$NON-NLS-1$
            w.writeAttribute("created", Long.toString(a.getCreated().getTime())); //$NON-NLS-1$
            w.writeAttribute("resolution", a.getResolution().toString()); //$NON-NLS-1$
            if (a.getResolved() != null)
                w.writeAttribute("resolved", Long.toString(a.getResolved().getTime())); //$NON-NLS-1$
            if (a.getModified() != null)
                w.writeAttribute("modified", Long.toString(a.getModified().getTime())); //$NON-NLS-1$
            if (a.getDescription() != null)
                w.writeAttribute("description", ApplicationHelper.escapeControls(a.getDescription())); //$NON-NLS-1$
            if (a.getStart() != null)
                w.writeAttribute("start", Long.toString(a.getStart().getTime())); //$NON-NLS-1$
            if (a.getRemind() != null)
                w.writeAttribute("remind", Long.toString(a.getRemind().getTime())); //$NON-NLS-1$
            if (a.getDue() != null)
                w.writeAttribute("due", Long.toString(a.getDue().getTime())); //$NON-NLS-1$
            if (a.getType() != null)
                w.writeAttribute("type", a.getType().toString()); //$NON-NLS-1$
            if (a.getUrl() != null)
                w.writeAttribute("url", a.getUrl().toString()); //$NON-NLS-1$
            if (a.isQueued())
                w.writeAttribute("queued", Boolean.toString(a.isQueued())); //$NON-NLS-1$
            if (a.getProject() != null)
                w.writeAttribute("project", a.getProject().toString()); //$NON-NLS-1$
            if (a.getPriority() != null)
                w.writeAttribute("priority", a.getPriority().toString()); //$NON-NLS-1$
            w.writeEndElement();
            w.writeCharacters(EOL);
        }
        w.writeCharacters(SKIP);
        w.writeEndElement();
        w.writeCharacters(EOL);
    }
    w.writeEndElement();
    w.writeCharacters(EOL);

    // Write projects
    Project[] pn = model.toProjectsArray();
    w.writeStartElement("projects"); //$NON-NLS-1$
    w.writeCharacters(EOL);

    for (int i = 0; i < pn.length; i++) {
        Project ff = pn[i];

        if (!filter.isAcceptable(ff, null)) {
            continue;
        }

        w.writeCharacters(SKIP);
        w.writeStartElement("project"); //$NON-NLS-1$
        w.writeAttribute("id", String.valueOf(ff.getId())); //$NON-NLS-1$
        w.writeAttribute("name", ff.getName()); //$NON-NLS-1$
        w.writeAttribute("closed", String.valueOf(ff.isClosed())); //$NON-NLS-1$
        if (ff.getCreated() != null)
            w.writeAttribute("created", Long.toString(ff.getCreated().getTime())); //$NON-NLS-1$
        if (ff.getModified() != null)
            w.writeAttribute("modified", Long.toString(ff.getModified().getTime())); //$NON-NLS-1$
        if (ff.getResolved() != null)
            w.writeAttribute("resolved", Long.toString(ff.getResolved().getTime())); //$NON-NLS-1$

        if (ff.getDescription() != null) {
            w.writeAttribute("description", ApplicationHelper.escapeControls(ff.getDescription())); //$NON-NLS-1$
        }

        StringBuilder sb = new StringBuilder();

        for (Action a : ff) {
            if (!filter.isAcceptable(ff, a)) {
                continue;
            }
            if (sb.length() > 0) {
                sb.append(","); //$NON-NLS-1$
            }
            sb.append(a.getId());
        }
        w.writeAttribute("actions", sb.toString()); //$NON-NLS-1$
        w.writeEndElement();
        w.writeCharacters(EOL);
    }
    w.writeEndElement();
    w.writeCharacters(EOL);

    // Write queue
    Folder f = model.getQueue();

    if (filter.isAcceptable(f, null)) {
        w.writeStartElement("queue"); //$NON-NLS-1$
        w.writeAttribute("id", String.valueOf(f.getId())); //$NON-NLS-1$
        w.writeAttribute("name", f.getName()); //$NON-NLS-1$

        StringBuilder sb = new StringBuilder();
        Iterator<Action> i = f.iterator();
        if (i.hasNext()) {
            sb.append(i.next().getId());
        }
        while (i.hasNext()) {
            sb.append(","); //$NON-NLS-1$
            sb.append(i.next().getId());
        }
        w.writeAttribute("actions", sb.toString()); //$NON-NLS-1$
        w.writeEndElement();
        w.writeCharacters(EOL);
    }

    // containers
    w.writeEndElement();
    w.writeEndDocument();

    w.flush();
    w.close();

    //changed=false;

}

From source file:org.icgc.dcc.portal.manifest.writer.GNOSManifestWriter.java

private static void startXmlDocument(XMLStreamWriter writer, long timestamp) throws XMLStreamException {
    writer.writeStartDocument(FILE_ENCODING, "1.0");
    writer.writeStartElement(GNOS_ROOT);
    writer.writeAttribute("date", formatToUtc(new Date(timestamp)));
}

From source file:org.netbeans.jbatch.modeler.spec.core.Definitions.java

static void transformXMLStream(XMLStreamReader xmlStreamReader, XMLStreamWriter xmlStreamWriter) {
    try {/* w  w  w  . j  a  v  a 2 s  . co m*/
        //            TransformerFactory tf = TransformerFactory.newInstance();
        //            Transformer t = tf.newTransformer();
        //            StAXSource source = new StAXSource(xmlStreamReader);
        //            StAXResult result = new StAXResult(xmlStreamWriter);
        //            t.transform(source, result);
        System.out.println("Defnition Id : " + xmlStreamReader.getAttributeValue(null, "id"));
        boolean finish = false;
        while (xmlStreamReader.hasNext() && !finish) {
            switch (xmlStreamReader.getEventType()) {
            case XMLEvent.START_ELEMENT:
                String prefix = xmlStreamReader.getPrefix();
                String namespaceURI = xmlStreamReader.getNamespaceURI();
                if (namespaceURI != null) {
                    if (prefix != null) {
                        xmlStreamWriter.writeStartElement(xmlStreamReader.getPrefix(),
                                xmlStreamReader.getLocalName(), xmlStreamReader.getNamespaceURI());
                    } else {
                        xmlStreamWriter.writeStartElement(xmlStreamReader.getNamespaceURI(),
                                xmlStreamReader.getLocalName());
                    }
                } else {
                    xmlStreamWriter.writeStartElement(xmlStreamReader.getLocalName());
                }

                for (int i = 0; i < xmlStreamReader.getNamespaceCount(); i++) {
                    xmlStreamWriter.writeNamespace(xmlStreamReader.getNamespacePrefix(i),
                            xmlStreamReader.getNamespaceURI(i));
                }
                int count = xmlStreamReader.getAttributeCount();
                for (int i = 0; i < count; i++) {
                    //                            xmlStreamWriter.writeAttribute(xmlStreamReader.getAttributePrefix(i),
                    //                                    xmlStreamReader.getAttributeNamespace(i),
                    //                                    xmlStreamReader.getAttributeLocalName(i),
                    //                                    xmlStreamReader.getAttributeValue(i));

                    String attrNamespaceURI = xmlStreamReader.getAttributeNamespace(i),
                            attrPrefix = xmlStreamReader.getAttributePrefix(i);
                    if (attrNamespaceURI != null) {
                        if (attrPrefix != null) {
                            xmlStreamWriter.writeAttribute(attrPrefix, attrNamespaceURI,
                                    xmlStreamReader.getAttributeLocalName(i),
                                    xmlStreamReader.getAttributeValue(i));
                        } else {
                            xmlStreamWriter.writeAttribute(attrNamespaceURI,
                                    xmlStreamReader.getAttributeLocalName(i),
                                    xmlStreamReader.getAttributeValue(i));
                        }
                    } else {
                        xmlStreamWriter.writeAttribute(xmlStreamReader.getAttributeLocalName(i),
                                xmlStreamReader.getAttributeValue(i));
                    }

                }
                break;
            case XMLEvent.END_ELEMENT:
                xmlStreamWriter.writeEndElement();
                if (xmlStreamReader.getLocalName().equals("definitions")) {
                    finish = true;
                }
                break;
            case XMLEvent.SPACE:
            case XMLEvent.CHARACTERS:
                xmlStreamWriter.writeCharacters(xmlStreamReader.getTextCharacters(),
                        xmlStreamReader.getTextStart(), xmlStreamReader.getTextLength());
                break;
            case XMLEvent.PROCESSING_INSTRUCTION:
                xmlStreamWriter.writeProcessingInstruction(xmlStreamReader.getPITarget(),
                        xmlStreamReader.getPIData());
                break;
            case XMLEvent.CDATA:
                xmlStreamWriter.writeCData(xmlStreamReader.getText());
                break;

            case XMLEvent.COMMENT:
                xmlStreamWriter.writeComment(xmlStreamReader.getText());
                break;
            case XMLEvent.ENTITY_REFERENCE:
                xmlStreamWriter.writeEntityRef(xmlStreamReader.getLocalName());
                break;
            case XMLEvent.START_DOCUMENT:
                String encoding = xmlStreamReader.getCharacterEncodingScheme();
                String version = xmlStreamReader.getVersion();

                if (encoding != null && version != null) {
                    xmlStreamWriter.writeStartDocument(encoding, version);
                } else if (version != null) {
                    xmlStreamWriter.writeStartDocument(xmlStreamReader.getVersion());
                }
                break;
            case XMLEvent.END_DOCUMENT:
                xmlStreamWriter.writeEndDocument();
                break;
            case XMLEvent.DTD:
                xmlStreamWriter.writeDTD(xmlStreamReader.getText());
                break;

            }
            if (!finish) {
                xmlStreamReader.next();
            }
        }
    } catch (XMLStreamException ex) {
        Exceptions.printStackTrace(ex);
    }
}

From source file:org.netbeans.jbatch.modeler.specification.model.job.util.JobUtil.java

void transformXMLStream(XMLStreamReader xmlStreamReader, XMLStreamWriter xmlStreamWriter) {
    try {/*  ww w  . j av a2  s .co m*/
        //            TransformerFactory tf = TransformerFactory.newInstance();
        //            Transformer t = tf.newTransformer();
        //            StAXSource source = new StAXSource(xmlStreamReader);
        //            StAXResult result = new StAXResult(xmlStreamWriter);
        //            t.transform(source, result);

        boolean finish = false;
        while (xmlStreamReader.hasNext() && !finish) {
            switch (xmlStreamReader.getEventType()) {
            case XMLEvent.START_ELEMENT:
                String prefix = xmlStreamReader.getPrefix();
                String namespaceURI = xmlStreamReader.getNamespaceURI();
                if (namespaceURI != null) {
                    if (prefix != null) {
                        xmlStreamWriter.writeStartElement(xmlStreamReader.getPrefix(),
                                xmlStreamReader.getLocalName(), xmlStreamReader.getNamespaceURI());
                    } else {
                        xmlStreamWriter.writeStartElement(xmlStreamReader.getNamespaceURI(),
                                xmlStreamReader.getLocalName());
                    }
                } else {
                    xmlStreamWriter.writeStartElement(xmlStreamReader.getLocalName());
                }

                for (int i = 0; i < xmlStreamReader.getNamespaceCount(); i++) {
                    xmlStreamWriter.writeNamespace(xmlStreamReader.getNamespacePrefix(i),
                            xmlStreamReader.getNamespaceURI(i));
                }
                int count = xmlStreamReader.getAttributeCount();
                for (int i = 0; i < count; i++) {
                    //                            xmlStreamWriter.writeAttribute(xmlStreamReader.getAttributePrefix(i),
                    //                                    xmlStreamReader.getAttributeNamespace(i),
                    //                                    xmlStreamReader.getAttributeLocalName(i),
                    //                                    xmlStreamReader.getAttributeValue(i));

                    String attrNamespaceURI = xmlStreamReader.getAttributeNamespace(i),
                            attrPrefix = xmlStreamReader.getAttributePrefix(i);
                    if (attrNamespaceURI != null) {
                        if (attrPrefix != null) {
                            xmlStreamWriter.writeAttribute(attrPrefix, attrNamespaceURI,
                                    xmlStreamReader.getAttributeLocalName(i),
                                    xmlStreamReader.getAttributeValue(i));
                        } else {
                            xmlStreamWriter.writeAttribute(attrNamespaceURI,
                                    xmlStreamReader.getAttributeLocalName(i),
                                    xmlStreamReader.getAttributeValue(i));
                        }
                    } else {
                        xmlStreamWriter.writeAttribute(xmlStreamReader.getAttributeLocalName(i),
                                xmlStreamReader.getAttributeValue(i));
                    }

                }
                break;
            case XMLEvent.END_ELEMENT:
                xmlStreamWriter.writeEndElement();
                if (xmlStreamReader.getLocalName().equals("definitions")) {
                    finish = true;
                }
                break;
            case XMLEvent.SPACE:
            case XMLEvent.CHARACTERS:
                xmlStreamWriter.writeCharacters(xmlStreamReader.getTextCharacters(),
                        xmlStreamReader.getTextStart(), xmlStreamReader.getTextLength());
                break;
            case XMLEvent.PROCESSING_INSTRUCTION:
                xmlStreamWriter.writeProcessingInstruction(xmlStreamReader.getPITarget(),
                        xmlStreamReader.getPIData());
                break;
            case XMLEvent.CDATA:
                xmlStreamWriter.writeCData(xmlStreamReader.getText());
                break;

            case XMLEvent.COMMENT:
                xmlStreamWriter.writeComment(xmlStreamReader.getText());
                break;
            case XMLEvent.ENTITY_REFERENCE:
                xmlStreamWriter.writeEntityRef(xmlStreamReader.getLocalName());
                break;
            case XMLEvent.START_DOCUMENT:
                String encoding = xmlStreamReader.getCharacterEncodingScheme();
                String version = xmlStreamReader.getVersion();

                if (encoding != null && version != null) {
                    xmlStreamWriter.writeStartDocument(encoding, version);
                } else if (version != null) {
                    xmlStreamWriter.writeStartDocument(xmlStreamReader.getVersion());
                }
                break;
            case XMLEvent.END_DOCUMENT:
                xmlStreamWriter.writeEndDocument();
                break;
            case XMLEvent.DTD:
                xmlStreamWriter.writeDTD(xmlStreamReader.getText());
                break;

            }
            if (!finish) {
                xmlStreamReader.next();
            }
        }
    } catch (XMLStreamException ex) {
        Exceptions.printStackTrace(ex);
    }
}

From source file:org.ops4j.pax.exam.karaf.container.internal.DependenciesDeployer.java

/**
 * Write a feature xml structure for test dependencies specified as ProvisionOption
 * in system to the given writer/*  w  w w .j av  a  2s  .com*/
 * 
 * @param writer where to write the feature xml
 * @param provisionOptions dependencies
 */
static void writeDependenciesFeature(Writer writer, ProvisionOption<?>... provisionOptions) {
    XMLOutputFactory xof = XMLOutputFactory.newInstance();
    xof.setProperty("javax.xml.stream.isRepairingNamespaces", true);
    XMLStreamWriter sw = null;
    try {
        sw = xof.createXMLStreamWriter(writer);
        sw.writeStartDocument("UTF-8", "1.0");
        sw.setDefaultNamespace(KARAF_FEATURE_NS);
        sw.writeCharacters("\n");
        sw.writeStartElement("features");
        sw.writeAttribute("name", "test-dependencies");
        sw.writeCharacters("\n");
        sw.writeStartElement("feature");
        sw.writeAttribute("name", "test-dependencies");
        sw.writeCharacters("\n");
        for (ProvisionOption<?> provisionOption : provisionOptions) {
            if (provisionOption.getURL().startsWith("link")
                    || provisionOption.getURL().startsWith("scan-features")) {
                // well those we've already handled at another location...
                continue;
            }
            sw.writeStartElement("bundle");
            if (provisionOption.getStartLevel() != null) {
                sw.writeAttribute("start-level", provisionOption.getStartLevel().toString());
            }
            sw.writeCharacters(provisionOption.getURL());
            endElement(sw);
        }
        endElement(sw);
        endElement(sw);
        sw.writeEndDocument();
    } catch (XMLStreamException e) {
        throw new RuntimeException("Error writing feature " + e.getMessage(), e);
    } finally {
        close(sw);
    }
}

From source file:org.plasma.sdo.xml.StreamMarshaller.java

private void write(XMLStreamWriter writer) throws XMLStreamException {
    setup();/*from w ww.ja  v a  2 s . co  m*/

    if (this.document.isXMLDeclaration()) {
        String encoding = findEncoding();
        if (encoding != null)
            writer.writeStartDocument(encoding, this.document.getXMLVersion());
        else
            writer.writeStartDocument(this.document.getXMLVersion());
    }

    // Write a processing instruction
    //writer.writeProcessingInstruction(
    //     "xml-stylesheet href='catalog.xsl' type='text/xsl'");   

    if (this.document.getRootElementName() != null) {
        //writer.writeDefaultNamespace(this.document.getRootElementURI());                   
        writer.writeStartElement(namespacePrefix, this.document.getRootElementName(),
                this.document.getRootElementURI());
        writeRootAttributes(writer);
    }

    EventVisitor visitor = new EventVisitor(writer);
    ((PlasmaDataObject) this.document.getRootObject()).accept(visitor);

    if (this.document.getRootElementName() != null) {
        writer.writeEndElement();
    }

    writer.writeEndDocument();
}

From source file:org.qi4j.valueserialization.stax.StaxValueSerializer.java

@Override
protected XMLStreamWriter adaptOutput(OutputStream output) throws Exception {
    XMLStreamWriter xmlStreamWriter = outputFactory.createXMLStreamWriter(output, "UTF-8");
    xmlStreamWriter.writeStartDocument("utf-8", "1.1");
    return xmlStreamWriter;
}