private void writeElement(Element element, Writer writer, int depth) throws IOException {
        for (int i = 0; i < depth; ++i) { writer.append(' '); }
        writer.append('<').append(element.getTagName());
        NamedNodeMap attrs = element.getAttributes();
        for (int i = 0, imax = attrs.getLength(); i < imax; ++i) {
            Attr attr = (Attr) attrs.item(i);
            writer.append(' ').append(attr.getName()).append("='").append(attr.getValue()).append("'");
        }
        NodeList nodes = element.getChildNodes();
        if (nodes.getLength() == 0) {
            // no children, so just close off the element and return
            writer.append("/>").append(lineSeparator);
            return;
        }
        writer.append('>').append(lineSeparator);
        for (int i = 0, imax = nodes.getLength(); i < imax; ++i) {
            Node n = nodes.item(i);
            if (n.getNodeType() == Node.ATTRIBUTE_NODE) { continue; }
            write(n, writer, depth + indent);
        }
        for (int i = 0; i < depth; ++i) { writer.append(' '); }
        writer.append("</").append(element.getTagName()).append('>').append(lineSeparator);
    }
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