List of usage examples for org.dom4j.io STAXEventWriter writeNode
public void writeNode(Node n) throws XMLStreamException
From source file:org.compass.core.xml.dom4j.converter.STAXReaderXmlContentConverter.java
License:Apache License
public String toXml1(XmlObject xmlObject) throws ConversionException { //TODO for some reason, this does not marshall at all, and also, will it be faster than dom4j XMLWriter? Dom4jXmlObject dom4jXmlObject = (Dom4jXmlObject) xmlObject; StringBuilderWriter stringWriter = StringBuilderWriter.Cached.cached(); try {/* w ww . j a va 2 s. co m*/ STAXEventWriter xmlWriter = new STAXEventWriter(stringWriter); xmlWriter.writeNode(dom4jXmlObject.getNode()); } catch (XMLStreamException e) { throw new ConversionException("Failed to write xml", e); } return stringWriter.toString(); }