public static String toJSON(PdxInstance pdxInstance) {
    return new JSONFormatter().fromPdxInstance(pdxInstance);
  }
Converts a PdxInstance into a JSON document in String form

@param pdxInstance the JSON string.
@return the JSON string
        JSONFormatterException if unable to create the JSON document
geode-core/src/main/java/org/apache/geode/pdx/JSONFormatter.java