private void generate(Pool cp) throws SAXException {
    if (version.compareTo(CacheXmlVersion.GEMFIRE_5_7) < 0) {
      return;
    }
    if (((PoolImpl) cp).isUsedByGateway()) {
      // no need to generate xml for gateway pools
      return;
    }
    AttributesImpl atts = new AttributesImpl();
    try {
      atts.addAttribute("", "", NAME, "", cp.getName());
      if (version.compareTo(CacheXmlVersion.GEODE_1_0) >= 0) {
        if (generateDefaults() || cp
            .getSubscriptionTimeoutMultiplier() != PoolFactory.DEFAULT_SUBSCRIPTION_TIMEOUT_MULTIPLIER) {
          atts.addAttribute("", "", SUBSCRIPTION_TIMEOUT_MULTIPLIER, "",
              String.valueOf(cp.getSubscriptionTimeoutMultiplier()));
        }
        if (generateDefaults()
            || cp.getSocketConnectTimeout() != PoolFactory.DEFAULT_SOCKET_CONNECT_TIMEOUT) {
          atts.addAttribute("", "", SOCKET_CONNECT_TIMEOUT, "",
              String.valueOf(cp.getSocketConnectTimeout()));
        }
      }
      if (generateDefaults()
          || cp.getFreeConnectionTimeout() != PoolFactory.DEFAULT_FREE_CONNECTION_TIMEOUT) {
        atts.addAttribute("", "", FREE_CONNECTION_TIMEOUT, "",
            String.valueOf(cp.getFreeConnectionTimeout()));
      }
      if (generateDefaults()
          || cp.getServerConnectionTimeout() != PoolFactory.DEFAULT_SERVER_CONNECTION_TIMEOUT) {
        atts.addAttribute("", "", SERVER_CONNECTION_TIMEOUT, "",
            String.valueOf(cp.getServerConnectionTimeout()));
      }
      if (generateDefaults()
          || cp.getLoadConditioningInterval() != PoolFactory.DEFAULT_LOAD_CONDITIONING_INTERVAL) {
        atts.addAttribute("", "", LOAD_CONDITIONING_INTERVAL, "",
            String.valueOf(cp.getLoadConditioningInterval()));
      }
      if (generateDefaults() || cp.getMinConnections() != PoolFactory.DEFAULT_MIN_CONNECTIONS) {
        atts.addAttribute("", "", MIN_CONNECTIONS, "", String.valueOf(cp.getMinConnections()));
      }
      if (generateDefaults() || cp.getMaxConnections() != PoolFactory.DEFAULT_MAX_CONNECTIONS) {
        atts.addAttribute("", "", MAX_CONNECTIONS, "", String.valueOf(cp.getMaxConnections()));
      }
      if (generateDefaults() || cp.getRetryAttempts() != PoolFactory.DEFAULT_RETRY_ATTEMPTS) {
        atts.addAttribute("", "", RETRY_ATTEMPTS, "", String.valueOf(cp.getRetryAttempts()));
      }
      if (generateDefaults() || cp.getIdleTimeout() != PoolFactory.DEFAULT_IDLE_TIMEOUT) {
        atts.addAttribute("", "", IDLE_TIMEOUT, "", String.valueOf(cp.getIdleTimeout()));
      }
      if (generateDefaults() || cp.getPingInterval() != PoolFactory.DEFAULT_PING_INTERVAL) {
        atts.addAttribute("", "", PING_INTERVAL, "", String.valueOf(cp.getPingInterval()));
      }
      if (generateDefaults()
          || cp.getStatisticInterval() != PoolFactory.DEFAULT_STATISTIC_INTERVAL) {
        atts.addAttribute("", "", STATISTIC_INTERVAL, "",
            String.valueOf(cp.getStatisticInterval()));
      }
      if (generateDefaults()
          || cp.getSubscriptionAckInterval() != PoolFactory.DEFAULT_SUBSCRIPTION_ACK_INTERVAL) {
        atts.addAttribute("", "", SUBSCRIPTION_ACK_INTERVAL, "",
            String.valueOf(cp.getSubscriptionAckInterval()));
      }
      if (generateDefaults()
          || cp.getSubscriptionEnabled() != PoolFactory.DEFAULT_SUBSCRIPTION_ENABLED) {
        atts.addAttribute("", "", SUBSCRIPTION_ENABLED, "",
            String.valueOf(cp.getSubscriptionEnabled()));
      }
      if (generateDefaults() || cp
          .getSubscriptionMessageTrackingTimeout() != PoolFactory.DEFAULT_SUBSCRIPTION_MESSAGE_TRACKING_TIMEOUT) {
        atts.addAttribute("", "", SUBSCRIPTION_MESSAGE_TRACKING_TIMEOUT, "",
            String.valueOf(cp.getSubscriptionMessageTrackingTimeout()));
      }
      if (generateDefaults()
          || cp.getSubscriptionRedundancy() != PoolFactory.DEFAULT_SUBSCRIPTION_REDUNDANCY) {
        atts.addAttribute("", "", SUBSCRIPTION_REDUNDANCY, "",
            String.valueOf(cp.getSubscriptionRedundancy()));
      }
      if (generateDefaults() || cp.getReadTimeout() != PoolFactory.DEFAULT_READ_TIMEOUT) {
        atts.addAttribute("", "", READ_TIMEOUT, "", String.valueOf(cp.getReadTimeout()));
      }
      if (cp.getServerGroup() != null && !cp.getServerGroup().equals("")) {
        atts.addAttribute("", "", SERVER_GROUP, "", cp.getServerGroup());
      }
      if (generateDefaults()
          || cp.getSocketBufferSize() != PoolFactory.DEFAULT_SOCKET_BUFFER_SIZE) {
        atts.addAttribute("", "", SOCKET_BUFFER_SIZE, "", String.valueOf(cp.getSocketBufferSize()));
      }
      if (generateDefaults()
          || cp.getThreadLocalConnections() != PoolFactory.DEFAULT_THREAD_LOCAL_CONNECTIONS) {
        atts.addAttribute("", "", THREAD_LOCAL_CONNECTIONS, "",
            String.valueOf(cp.getThreadLocalConnections()));
      }

      if (version.compareTo(CacheXmlVersion.GEMFIRE_6_1) > 0) {
        if (generateDefaults()
            || cp.getPRSingleHopEnabled() != PoolFactory.DEFAULT_PR_SINGLE_HOP_ENABLED) {
          atts.addAttribute("", "", PR_SINGLE_HOP_ENABLED, "",
              String.valueOf(cp.getPRSingleHopEnabled()));
        }
      }

      if (version.compareTo(CacheXmlVersion.GEMFIRE_6_1) > 0) {
        if (generateDefaults()
            || cp.getMultiuserAuthentication() != PoolFactory.DEFAULT_MULTIUSER_AUTHENTICATION) {
          atts.addAttribute("", "", MULTIUSER_SECURE_MODE_ENABLED, "",
              String.valueOf(cp.getMultiuserAuthentication()));
        }
      }
    } finally {
      handler.startElement("", CONNECTION_POOL, CONNECTION_POOL, atts);
      {
        for (InetSocketAddress addr : cp.getLocators()) {
          AttributesImpl sAtts = new AttributesImpl();
          sAtts.addAttribute("", "", HOST, "", addr.getHostString());
          sAtts.addAttribute("", "", PORT, "", String.valueOf(addr.getPort()));
          handler.startElement("", LOCATOR, LOCATOR, sAtts);
          handler.endElement("", LOCATOR, LOCATOR);
        }
      }
      {
        for (InetSocketAddress addr : cp.getServers()) {
          AttributesImpl sAtts = new AttributesImpl();
          sAtts.addAttribute("", "", HOST, "", addr.getHostString());
          sAtts.addAttribute("", "", PORT, "", String.valueOf(addr.getPort()));
          handler.startElement("", SERVER, SERVER, sAtts);
          handler.endElement("", SERVER, SERVER);
        }
        if (version.compareTo(CacheXmlVersion.GEODE_1_0) >= 0) {
          if (cp.getSocketFactory() != PoolFactory.DEFAULT_SOCKET_FACTORY) {
            generate(SOCKET_FACTORY, cp.getSocketFactory());
          }
        }
      }
      handler.endElement("", "", CONNECTION_POOL);
    }
  }
Generates XML for the given connection pool

@since GemFire 5.7
geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java