@Override
    public void write(Savable[][] value, String name, Savable[][] defVal) throws IOException {
        if (value == null || Arrays.deepEquals(value, defVal)) {
            return;
        }

        Element old = currentElement;

        appendElement(name);

        XMLUtils.setAttribute(currentElement, XMLExporter.ATTRIBUTE_SIZE, String.valueOf(value.length));
        for (int i = 0; i < value.length; i++) {
            String childName = "savable_array_" + i;
            if (value[i] != null) {
                write(value[i], childName, null);
            } else {
                appendElement(childName);
                currentElement = (Element) currentElement.getParentNode();
            }
        }

        currentElement = old;
    }
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