Buggy code:
writer . writeStartElement ( Element . STATE_TRANSFER . getLocalName ( ) ) ; this . writeOptional ( writer , ENABLED , stateTransfer , ModelKeys . ENABLED ) ; this . writeOptional ( writer , TIMEOUT , stateTransfer , ModelKeys . TIMEOUT ) ; this . writeOptional ( writer , CHUNK_SIZE , stateTransfer , ModelKeys . CHUNK_SIZE ) ; writer . writeEndElement ( ) ; } if ( cache . get ( STORE , STORE_NAME ) . isDefined ( ) ) { ModelNode store = cache . get ( STORE , STORE_NAME ) ; writer . writeStartElement ( Element . STORE . getLocalName ( ) ) ; this . writeRequired ( writer , CLASS , store , ModelKeys . CLASS ) ; this . writeStoreAttributes ( writer , store ) ; this . writeStoreWriteBehind ( writer , store ) ; this . writeStoreProperties ( writer , store ) ; writer . writeEndElement ( ) ; } if ( cache . get ( FILE_STORE , FILE_STORE_NAME ) . isDefined ( ) ) { ModelNode store = cache . get ( FILE_STORE , FILE_STORE_NAME ) ; writer . writeStartElement ( Element . FILE_STORE . getLocalName ( ) ) ; this . writeOptional ( writer , RELATIVE_TO , store , ModelKeys . RELATIVE_TO ) ; this . writeOptional ( writer , PATH , store , ModelKeys . PATH ) ; this . writeStoreAttributes ( writer , store ) ; this . writeStoreWriteBehind ( writer , store ) ; this . writeStoreProperties ( writer , store ) ; writer . writeEndElement ( ) ; } if ( cache . get ( STRING_KEYED_JDBC_STORE , STRING_KEYED_JDBC_STORE_NAME ) . isDefined ( ) ) { ModelNode store = cache . get ( STRING_KEYED_JDBC_STORE , STRING_KEYED_JDBC_STORE_NAME ) ; writer . writeStartElement ( Element . STRING_KEYED_JDBC_STORE . getLocalName ( ) ) ; this . writeRequired ( writer , DATASOURCE , store , ModelKeys . DATASOURCE ) ; this . writeStoreAttributes ( writer , store ) ; this . writeStoreWriteBehind ( writer , store ) ; this . writeStoreProperties ( writer , store ) ; this . writeJDBCStoreTable ( writer , STRING_KEYED_TABLE , store , ModelKeys . STRING_KEYED_TABLE ) ; writer . writeEndElement ( ) ; } if ( cache . get ( BINARY_KEYED_JDBC_STORE , BINARY_KEYED_JDBC_STORE_NAME ) . isDefined ( ) ) { ModelNode store = cache . get ( BINARY_KEYED_JDBC_STORE , BINARY_KEYED_JDBC_STORE_NAME ) ; writer . writeStartElement ( Element . BINARY_KEYED_JDBC_STORE . getLocalName ( ) ) ; this . writeRequired ( writer , DATASOURCE , store , ModelKeys . DATASOURCE ) ; this . writeStoreAttributes ( writer , store ) ; this . writeStoreWriteBehind ( writer , store ) ; this . writeStoreProperties ( writer , store ) ; this . writeJDBCStoreTable ( writer , BINARY_KEYED_TABLE , store , ModelKeys . BINARY_KEYED_TABLE ) ; writer . writeEndElement ( ) ; } if ( cache . get ( MIXED_KEYED_JDBC_STORE , MIXED_KEYED_JDBC_STORE_NAME ) . isDefined ( ) ) { ModelNode store = cache . get ( MIXED_KEYED_JDBC_STORE , MIXED_KEYED_JDBC_STORE_NAME ) ; writer . writeStartElement ( Element . MIXED_KEYED_JDBC_STORE . getLocalName ( ) ) ; this . writeRequired ( writer , DATASOURCE , store , ModelKeys . DATASOURCE ) ; this . writeStoreAttributes ( writer , store ) ; this . writeStoreWriteBehind ( writer , store ) ; this . writeStoreProperties ( writer , store ) ; this . writeJDBCStoreTable ( writer , STRING_KEYED_TABLE , store , ModelKeys . STRING_KEYED_TABLE ) ; this . writeJDBCStoreTable ( writer , BINARY_KEYED_TABLE , store , ModelKeys . BINARY_KEYED_TABLE ) ; writer . writeEndElement ( ) ; } if ( cache . get ( REMOTE_STORE , REMOTE_STORE_NAME ) . isDefined ( ) ) { ModelNode store = cache . get ( REMOTE_STORE , REMOTE_STORE_NAME ) ; writer . writeStartElement ( Element . REMOTE_STORE . getLocalName ( ) ) ; this . writeOptional ( writer , CACHE , store , ModelKeys . CACHE ) ; this . writeOptional ( writer , SOCKET_TIMEOUT , store , ModelKeys . SOCKET_TIMEOUT ) ; this . writeOptional ( writer , TCP_NO_DELAY , store , ModelKeys . TCP_NO_DELAY ) ; this . writeStoreAttributes ( writer , store ) ; this . writeStoreWriteBehind ( writer , store ) ; this . writeStoreProperties ( writer , store ) ; for ( ModelNode remoteServer : store . get ( REMOTE_SERVERS ) . asList ( ) ) { writer . writeStartElement ( REMOTE_SERVER . getLocalName ( ) ) ; writer . writeAttribute ( OUTBOUND_SOCKET_BINDING . getLocalName ( ) , remoteServer . get ( ModelKeys . OUTBOUND_SOCKET_BINDING ) . asString ( ) ) ; writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ; } if ( ( cache . get ( INDEXING ) . isDefined ( ) ) || ( cache . get ( INDEXING_PROPERTIES ) . isDefined ( ) ) ) { writer . writeStartElement ( Element . INDEXING . getLocalName ( ) ) ; CommonAttributes . INDEXING . marshallAsAttribute ( cache , writer ) ; <START_BUG> CommonAttributes . INDEXING_PROPERTIES . marshalToElement ( cache . get ( INDEXING_PROPERTIES ) , writer ) ; <END_BUG> writer . writeEndElement ( ) ; } } private void writeAliases ( XMLExtendedStreamWriter writer , Attribute attribute , ModelNode container , String key ) throws XMLStreamException { } private void writeJDBCStoreTable ( XMLExtendedStreamWriter writer , Element element , ModelNode store , String key ) throws XMLStreamException { } private void writeJDBCStoreColumn ( XMLExtendedStreamWriter writer , Element element , ModelNode table , String key ) throws XMLStreamException { } private void writeStoreAttributes ( XMLExtendedStreamWriter writer , ModelNode store ) throws XMLStreamException { } private void writeStoreWriteBehind ( XMLExtendedStreamWriter writer , ModelNode store ) throws XMLStreamException { } private void writeStoreProperties ( XMLExtendedStreamWriter writer , ModelNode store ) throws XMLStreamException { } private void writeOptional ( XMLExtendedStreamWriter writer , Attribute attribute , ModelNode model , String key ) throws XMLStreamException { } private void writeRequired ( XMLExtendedStreamWriter writer , Attribute attribute , ModelNode model , String key ) throws XMLStreamException { } }

Fix:
CommonAttributes . INDEXING_PROPERTIES . marshallAsElement ( cache , writer ) ;