code: @SuppressWarnings("deprecation")
      public Element toElement(final ElasticSearchDatastore datastore) {
          final Element ds = getDocument().createElement("elasticsearch-datastore");
          ds.setAttribute("name", datastore.getName());
          if (!Strings.isNullOrEmpty(datastore.getDescription())) {
              ds.setAttribute("description", datastore.getDescription());
          }
  
          appendElement(ds, "hostname", datastore.getHostname());
          appendElement(ds, "port", datastore.getPort());
          appendElement(ds, "cluster-name", datastore.getClusterName());
          appendElement(ds, "index-name", datastore.getIndexName());
          appendElement(ds, "client-type", datastore.getClientType().name());
          appendElement(ds, "username", datastore.getUsername());
          appendElement(ds, "password", encodePassword(datastore.getPassword()));
          appendElement(ds, "ssl", datastore.getSsl());
  
          if (datastore.getSsl()) {
              appendElement(ds, "keystore-path", datastore.getKeystorePath());
              appendElement(ds, "keystore-password", encodePassword(datastore.getKeystorePassword()));
          }
  
          return ds;
      }
docs: Externalizes a {@link ElasticSearchDatastore} to a XML element
  
  @param datastore
  @return