code: @Override
      public void marshallAsXml(final ModelNode model, final OutputStream output) throws ConfigurationPersistenceException {
          final XMLMapper mapper = XMLMapper.Factory.create();
          final Map<String, XMLElementWriter<SubsystemMarshallingContext>> localSubsystemWriters = new HashMap<>(subsystemWriters);
          try {
              XMLStreamWriter streamWriter = null;
              try {
                  streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(output);
                  final ModelMarshallingContext extensibleModel = new ModelMarshallingContext() {
  
                      @Override
                      public ModelNode getModelNode() {
                          return model;
                      }
  
                      @Override
                      public XMLElementWriter<SubsystemMarshallingContext> getSubsystemWriter(String extensionName) {
                          //lazy create writer, but only once per config serialization
                          XMLElementWriter<SubsystemMarshallingContext> result = localSubsystemWriters.get(extensionName);
                          if (result == null) {
                              Supplier<XMLElementWriter<SubsystemMarshallingContext>> supplier = subsystemWriterSuppliers.get(extensionName);
                              if (supplier != null) {
                                  result = supplier.get();
                                  localSubsystemWriters.put(extensionName, result);
                              }
                          }
                          return result;
                      }
                  };
                  mapper.deparseDocument(rootDeparser, extensibleModel, streamWriter);
                  streamWriter.close();
              } finally {
                  safeClose(streamWriter);
              }
          } catch (Exception e) {
              throw ControllerLogger.ROOT_LOGGER.failedToWriteConfiguration(e);
          }
      }
docs: {@inheritDoc}