code: public JSONObject getJson() throws JSONException {
          JSONObject json = create();
          json.put("processInstance", processInstance.getJson());
          if (!children.isEmpty()) {
              JSONArray childrenArr = new JSONArray();
              for (LinkedProcessInstance child : children) {
                  childrenArr.put(child.getJson());
              }
              json.put("children", childrenArr);
          }
          return json;
      }
docs: Includes children (not parent).