private void writePrimitiveArray2DHelper(Object[] value, String name) throws IOException {
        appendElement(name);

        XMLUtils.setAttribute(currentElement, XMLExporter.ATTRIBUTE_SIZE, String.valueOf(value.length));

        // tag names are not used for anything by DOMInputCapsule, but for the sake of readability, it's nice to know what type of array this is.
        String childNamePrefix = value.getClass().getComponentType().getSimpleName().toLowerCase();
        childNamePrefix = childNamePrefix.replace("[]", "_array_");

        for (int i = 0; i < value.length; i++) {
            String childName = childNamePrefix + i;

            if (value[i] != null) {
                writePrimitiveArrayHelper(value[i], childName);
            } else {
                // empty tag
                appendElement(childName);
                currentElement = (Element) currentElement.getParentNode();
            }
        }

        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