Buggy code:
class WebSubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { private static final WebSubsystemParser INSTANCE = new WebSubsystemParser ( ) ; private static final String RULE_PREFIX = "rule-" ; private static final String CONDITION_PREFIX = "condition-" ; static WebSubsystemParser getInstance ( ) { } @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { context . startSubsystemElement ( CURRENT . getUriString ( ) , false ) ; ModelNode node = context . getModelNode ( ) ; DEFAULT_VIRTUAL_SERVER . marshallAsAttribute ( node , true , writer ) ; INSTANCE_ID . marshallAsAttribute ( node , false , writer ) ; NATIVE . marshallAsAttribute ( node , true , writer ) ; if ( node . hasDefined ( Constants . CONFIGURATION ) ) { writeContainerConfig ( writer , node . get ( Constants . CONFIGURATION ) ) ; } if ( node . hasDefined ( Constants . CONNECTOR ) ) { for ( final Property connector : node . get ( Constants . CONNECTOR ) . asPropertyList ( ) ) { final ModelNode config = connector . getValue ( ) ; writer . writeStartElement ( CONNECTOR . getLocalName ( ) ) ; writer . writeAttribute ( Constants . NAME , connector . getName ( ) ) ; for ( SimpleAttributeDefinition attr : WebConnectorDefinition . CONNECTOR_ATTRIBUTES ) { <START_BUG> attr . marshallAsAttribute ( config , false , writer ) ; <END_BUG> } if ( config . get ( WebExtension . SSL_PATH . getKey ( ) , WebExtension . SSL_PATH . getValue ( ) ) . isDefined ( ) ) { ModelNode sslConfig = config . get ( WebExtension . SSL_PATH . getKey ( ) , WebExtension . SSL_PATH . getValue ( ) ) ; writer . writeStartElement ( SSL . getLocalName ( ) ) ; NAME . marshallAsAttribute ( sslConfig , writer ) ; for ( SimpleAttributeDefinition attr : WebSSLDefinition . SSL_ATTRIBUTES ) { attr . marshallAsAttribute ( sslConfig , false , writer ) ; } writer . writeEndElement ( ) ; } if ( config . hasDefined ( Constants . VIRTUAL_SERVER ) ) { for ( final ModelNode virtualServer : config . get ( Constants . VIRTUAL_SERVER ) . asList ( ) ) { writer . writeEmptyElement ( Constants . VIRTUAL_SERVER ) ; writer . writeAttribute ( Constants . NAME , virtualServer . asString ( ) ) ; } } writer . writeEndElement ( ) ; } } if ( node . hasDefined ( Constants . VIRTUAL_SERVER ) ) { for ( final Property host : node . get ( Constants . VIRTUAL_SERVER ) . asPropertyList ( ) ) { final ModelNode config = host . getValue ( ) ; writer . writeStartElement ( VIRTUAL_SERVER . getLocalName ( ) ) ; writer . writeAttribute ( Constants . NAME , host . getName ( ) ) ; ENABLE_WELCOME_ROOT . marshallAsAttribute ( config , true , writer ) ; DEFAULT_WEB_MODULE . marshallAsAttribute ( config , true , writer ) ; if ( config . hasDefined ( Constants . ALIAS ) ) { for ( final ModelNode alias : config . get ( Constants . ALIAS ) . asList ( ) ) { writer . writeEmptyElement ( Constants . ALIAS ) ; writer . writeAttribute ( Constants . NAME , alias . asString ( ) ) ; } } if ( config . get ( WebExtension . ACCESS_LOG_PATH . getKey ( ) , WebExtension . ACCESS_LOG_PATH . getValue ( ) ) . isDefined ( ) ) { ModelNode accessLog = config . get ( WebExtension . ACCESS_LOG_PATH . getKey ( ) , WebExtension . ACCESS_LOG_PATH . getValue ( ) ) ; writer . writeStartElement ( ACCESS_LOG . getLocalName ( ) ) ; for ( SimpleAttributeDefinition attr : WebAccessLogDefinition . ACCESS_LOG_ATTRIBUTES ) { attr . marshallAsAttribute ( accessLog , false , writer ) ; } if ( accessLog . get ( WebExtension . DIRECTORY_PATH . getKey ( ) , WebExtension . DIRECTORY_PATH . getValue ( ) ) . isDefined ( ) ) { ModelNode directory = accessLog . get ( WebExtension . DIRECTORY_PATH . getKey ( ) , WebExtension . DIRECTORY_PATH . getValue ( ) ) ; String name = DIRECTORY . getLocalName ( ) ; boolean startwritten = false ; startwritten = writeAttribute ( writer , PATH , directory , startwritten , name ) ; startwritten = writeAttribute ( writer , RELATIVE_TO , directory , startwritten , name ) ; if ( startwritten ) { writer . writeEndElement ( ) ; } } writer . writeEndElement ( ) ; } if ( config . hasDefined ( Constants . REWRITE ) ) { for ( final ModelNode rewritenode : config . get ( Constants . REWRITE ) . asList ( ) ) { Property prop = rewritenode . asProperty ( ) ; ModelNode rewrite = prop . getValue ( ) ; writer . writeStartElement ( Constants . REWRITE ) ; writer . writeAttribute ( Constants . NAME , prop . getName ( ) ) ; PATTERN . marshallAsAttribute ( rewrite , false , writer ) ; SUBSTITUTION . marshallAsAttribute ( rewrite , false , writer ) ; FLAGS . marshallAsAttribute ( rewrite , false , writer ) ; if ( rewrite . hasDefined ( Constants . CONDITION ) ) { for ( final ModelNode conditionnode : rewrite . get ( Constants . CONDITION ) . asList ( ) ) { Property conditionProp = conditionnode . asProperty ( ) ; ModelNode condition = conditionProp . getValue ( ) ; writer . writeStartElement ( Constants . CONDITION ) ; writer . writeAttribute ( Constants . NAME , conditionProp . getName ( ) ) ; TEST . marshallAsAttribute ( condition , false , writer ) ; WebReWriteConditionDefinition . PATTERN . marshallAsAttribute ( condition , false , writer ) ; WebReWriteConditionDefinition . FLAGS . marshallAsAttribute ( condition , false , writer ) ; writer . writeEndElement ( ) ; } } writer . writeEndElement ( ) ; } }

Fix:
attr . marshallAsAttribute ( config , true , writer ) ;