@Override
public void marshallAsElement(ModelNode eeSubSystem, XMLStreamWriter writer) throws XMLStreamException {
if (eeSubSystem.hasDefined(getName()) && eeSubSystem.asInt() > 0) {
writer.writeStartElement(Element.GLOBAL_MODULES.getLocalName());
final ModelNode globalModules = eeSubSystem.get(getName());
for (ModelNode module : globalModules.asList()) {
writer.writeEmptyElement(Element.MODULE.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), module.get(NAME).asString());
if (module.hasDefined(SLOT)) {
writer.writeAttribute(Attribute.SLOT.getLocalName(), module.get(SLOT).asString());
}