private void writeWorkerThreadPoolIfAttributesSet(
      final XMLExtendedStreamWriter writer, final ModelNode node) throws XMLStreamException {
    if (node.hasDefined(CommonAttributes.WORKER_READ_THREADS)
        || node.hasDefined(CommonAttributes.WORKER_TASK_CORE_THREADS)
        || node.hasDefined(CommonAttributes.WORKER_TASK_KEEPALIVE)
        || node.hasDefined(CommonAttributes.WORKER_TASK_LIMIT)
        || node.hasDefined(CommonAttributes.WORKER_TASK_MAX_THREADS)
        || node.hasDefined(CommonAttributes.WORKER_WRITE_THREADS)) {

      writer.writeStartElement(Element.WORKER_THREAD_POOL.getLocalName());

      RemotingSubsystemRootResource.WORKER_READ_THREADS.marshallAsAttribute(node, false, writer);
      RemotingSubsystemRootResource.WORKER_TASK_CORE_THREADS.marshallAsAttribute(
          node, false, writer);
      RemotingSubsystemRootResource.WORKER_TASK_KEEPALIVE.marshallAsAttribute(node, false, writer);
      RemotingSubsystemRootResource.WORKER_TASK_LIMIT.marshallAsAttribute(node, false, writer);
      RemotingSubsystemRootResource.WORKER_TASK_MAX_THREADS.marshallAsAttribute(
          node, false, writer);
      RemotingSubsystemRootResource.WORKER_WRITE_THREADS.marshallAsAttribute(node, false, writer);

      writer.writeEndElement();
    }
  }