code: public Element toElement(final MongoDbDatastore datastore) {
          final Element ds = getDocument().createElement("mongodb-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, "database-name", datastore.getDatabaseName());
          appendElement(ds, "username", datastore.getUsername());
          appendElement(ds, "password", encodePassword(datastore.getPassword()));
  
          return ds;
      }
docs: Externalizes a {@link MongoDbDatastore} to a XML element
  
  @param datastore
  @return