private void writePrimitiveArrayHelper(Object value, String name) throws IOException {
        StringBuilder sb = new StringBuilder();

        for(int i = 0; i < Array.getLength(value); i++) {
            sb.append(Array.get(value, i));
            sb.append(" ");
        }

        // remove last space
        sb.setLength(Math.max(0, sb.length() - 1));

        appendElement(name);
        XMLUtils.setAttribute(currentElement, XMLExporter.ATTRIBUTE_SIZE, String.valueOf(Array.getLength(value)));
        XMLUtils.setAttribute(currentElement, XMLExporter.ATTRIBUTE_DATA, sb.toString());

        currentElement = (Element) currentElement.getParentNode();
    }
appends a new Element with the given name to currentElement, sets
currentElement to be new Element, and returns the new Element as well
jme3-plugins/src/xml/java/com/jme3/export/xml/DOMOutputCapsule.java