Buggy code:
public class DataSourcesExtension implements Extension { public static final String SUBSYSTEM_NAME = Constants . DATASOURCES ; @ Override public void initialize ( final ExtensionContext context ) { } @ Override public void initializeParsers ( final ExtensionParsingContext context ) { } public static final class NewDataSourceSubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { static final DataSourcesExtension . NewDataSourceSubsystemParser INSTANCE = new DataSourcesExtension . NewDataSourceSubsystemParser ( ) ; @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { context . startSubsystemElement ( CURRENT . getUriString ( ) , false ) ; ModelNode node = context . getModelNode ( ) ; writer . writeStartElement ( Constants . DATASOURCES ) ; if ( ( node . hasDefined ( Constants . DATA_SOURCE ) ) || ( node . hasDefined ( Constants . XA_DATASOURCE ) ) ) { List < Property > propertyList = ( node . hasDefined ( Constants . DATA_SOURCE ) ) ? node . get ( Constants . DATA_SOURCE ) . asPropertyList ( ) : new LinkedList < Property > ( ) ; if ( node . hasDefined ( Constants . XA_DATASOURCE ) ) { propertyList . addAll ( node . get ( Constants . XA_DATASOURCE ) . asPropertyList ( ) ) ; } for ( Property property : propertyList ) { final ModelNode dataSourceNode = property . getValue ( ) ; boolean isXADataSource = hasAnyOf ( dataSourceNode , Constants . XA_RESOURCE_TIMEOUT , Constants . XADATASOURCECLASS , Constants . XADATASOURCE_PROPERTIES ) ; writer . writeStartElement ( ( isXADataSource ? XA_DATASOURCE . getLocalName ( ) : DATASOURCE . getLocalName ( ) ) ) ; Constants . JNDINAME . marshallAsAttribute ( dataSourceNode , false , writer ) ; Constants . POOLNAME . marshallAsAttribute ( dataSourceNode , false , writer ) ; <START_BUG> Constants . ENABLED . marshallAsAttribute ( dataSourceNode , false , writer ) ; <END_BUG> Constants . JTA . marshallAsAttribute ( dataSourceNode , false , writer ) ; Constants . USE_JAVA_CONTEXT . marshallAsAttribute ( dataSourceNode , false , writer ) ; Constants . SPY . marshallAsAttribute ( dataSourceNode , false , writer ) ; Constants . USE_CCM . marshallAsAttribute ( dataSourceNode , false , writer ) ; if ( ! isXADataSource ) { Constants . CONNECTION_URL . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . DRIVER_CLASS . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . DATASOURCE_CLASS . marshallAsElement ( dataSourceNode , false , writer ) ; if ( dataSourceNode . hasDefined ( Constants . CONNECTION_PROPERTIES . getName ( ) ) ) { for ( Property connectionProperty : dataSourceNode . get ( Constants . CONNECTION_PROPERTIES . getName ( ) ) . asPropertyList ( ) ) { writeProperty ( writer , dataSourceNode , connectionProperty . getName ( ) , connectionProperty . getValue ( ) . get ( "value" ) . asString ( ) , CONNECTION_PROPERTY . getLocalName ( ) ) ; } } } if ( isXADataSource ) { if ( dataSourceNode . hasDefined ( Constants . XADATASOURCE_PROPERTIES . getName ( ) ) ) { for ( Property prop : dataSourceNode . get ( Constants . XADATASOURCE_PROPERTIES . getName ( ) ) . asPropertyList ( ) ) { writeProperty ( writer , dataSourceNode , prop . getName ( ) , prop . getValue ( ) . get ( "value" ) . asString ( ) , XA_DATASOURCE_PROPERTY . getLocalName ( ) ) ; } } Constants . XADATASOURCECLASS . marshallAsElement ( dataSourceNode , false , writer ) ; } Constants . DATASOURCE_DRIVER . marshallAsElement ( dataSourceNode , false , writer ) ; if ( isXADataSource ) { Constants . URL_DELIMITER . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . URL_SELECTOR_STRATEGY_CLASS_NAME . marshallAsElement ( dataSourceNode , false , writer ) ; } Constants . NEW_CONNECTION_SQL . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . TRANSACTION_ISOLATION . marshallAsElement ( dataSourceNode , false , writer ) ; if ( ! isXADataSource ) { Constants . URL_DELIMITER . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . URL_SELECTOR_STRATEGY_CLASS_NAME . marshallAsElement ( dataSourceNode , false , writer ) ; } boolean poolRequired = hasAnyOf ( dataSourceNode , MIN_POOL_SIZE , MAX_POOL_SIZE , POOL_PREFILL , POOL_USE_STRICT_MIN , POOL_FLUSH_STRATEGY ) ; if ( isXADataSource ) { poolRequired = poolRequired || ( hasAnyOf ( dataSourceNode , Constants . SAME_RM_OVERRIDE , Constants . INTERLEAVING , Constants . NOTXSEPARATEPOOL , Constants . PAD_XID , Constants . WRAP_XA_RESOURCE ) ) ; } if ( poolRequired ) { writer . writeStartElement ( ( isXADataSource ? XA_POOL . getLocalName ( ) : POOL . getLocalName ( ) ) ) ; MIN_POOL_SIZE . marshallAsElement ( dataSourceNode , false , writer ) ; MAX_POOL_SIZE . marshallAsElement ( dataSourceNode , false , writer ) ; POOL_PREFILL . marshallAsElement ( dataSourceNode , false , writer ) ; POOL_USE_STRICT_MIN . marshallAsElement ( dataSourceNode , false , writer ) ; POOL_FLUSH_STRATEGY . marshallAsElement ( dataSourceNode , false , writer ) ; if ( isXADataSource ) { Constants . SAME_RM_OVERRIDE . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . INTERLEAVING . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . NOTXSEPARATEPOOL . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . PAD_XID . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . WRAP_XA_RESOURCE . marshallAsElement ( dataSourceNode , false , writer ) ; } writer . writeEndElement ( ) ; } boolean securityRequired = hasAnyOf ( dataSourceNode , Constants . USERNAME , Constants . PASSWORD , Constants . SECURITY_DOMAIN , Constants . REAUTHPLUGIN_CLASSNAME , Constants . REAUTHPLUGIN_PROPERTIES ) ; if ( securityRequired ) { writer . writeStartElement ( SECURITY . getLocalName ( ) ) ; Constants . USERNAME . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . PASSWORD . marshallAsElement ( dataSourceNode , false , writer ) ; Constants . SECURITY_DOMAIN . marshallAsElement ( dataSourceNode , false , writer ) ;

Fix:
Constants . ENABLED . marshallAsAttribute ( dataSourceNode , writer ) ;