private void write(Node node, Writer writer, int depth) throws IOException {
        switch (node.getNodeType()) {
        case Node.DOCUMENT_NODE:
            writeDocument((Document) node, writer);
            break;
        case Node.ELEMENT_NODE:
            writeElement((Element) node, writer, depth);
            break;
        case Node.TEXT_NODE:
            escape(writer, node.getNodeValue());
            break;
        case Node.CDATA_SECTION_NODE:
            writer.write("<![CDATA[");
            escape(writer, node.getNodeValue());
            writer.write("]]>");
            break;
        case Node.COMMENT_NODE:
            for (int i = 0; i < depth; ++i) { writer.append(' '); }
            writer.append("<!-- ").append(node.getNodeValue()).append(" -->").append(lineSeparator);
            break;
        case Node.PROCESSING_INSTRUCTION_NODE:
            String n = node.getNodeName();
            String v = node.getNodeValue();
            for (int i = 0; i < depth; ++i) { writer.append(' '); }
            writer.append("<?").append(n).append(' ').append(v).append("?>").append(lineSeparator);
            break;
        case Node.ENTITY_REFERENCE_NODE:
            writer.append('&').append(node.getNodeName()).append(';');
            break;
        case Node.DOCUMENT_TYPE_NODE:
            writeDocumentType((DocumentType) node, writer, depth);
            break;
        }
    }
Set the line separator that will be used when serializing documents.
<p>
If this is not called then the serializer uses a default based on the
{@code line.separator} system property. 

@param lineSeparator the line separator to set.
jme3-plugins/src/xml/java/com/jme3/export/xml/DOMSerializer.java