@Override
    public void writeByteBufferArrayList(ArrayList<ByteBuffer> value, String name, ArrayList<ByteBuffer> defVal) throws IOException {
        if (value == null || value.equals(defVal)) {
            return;
        }

        appendElement(name);

        XMLUtils.setAttribute(currentElement, XMLExporter.ATTRIBUTE_SIZE, String.valueOf(value.size()));
        for (int i = 0; i < value.size(); i++) {
            String childName = "byte_buffer_" + i;
            if (value.get(i) != null) {
                write(value.get(i), childName, null);
            } else {
                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