docs: protected Node addNode( Node parentNode,
                              String nodeName,
                              JSONObject jsonNode ) throws RepositoryException, JSONException {
          Node newNode;
  
          JSONObject properties = getProperties(jsonNode);
  
          if (properties.has(PRIMARY_TYPE_PROPERTY)) {
              String primaryType = properties.getString(PRIMARY_TYPE_PROPERTY);
              newNode = parentNode.addNode(nodeName, primaryType);
          } else {
              newNode = parentNode.addNode(nodeName);
          }
  
          if (properties.has(MIXIN_TYPES_PROPERTY)) {
              // Be sure to set this property first, before the other properties in case the other properties
              // are defined only on one of the mixin types ...
              updateMixins(newNode, properties.get(MIXIN_TYPES_PROPERTY));
          }
  
          for (Iterator<?> iter = properties.keys(); iter.hasNext();) {
              String key = (String)iter.next();
  
              if (PRIMARY_TYPE_PROPERTY.equals(key) || MIXIN_TYPES_PROPERTY.equals(key)) {
                  continue;
              }
              setPropertyOnNode(newNode, key, properties.get(key));
          }
  
          if (hasChildren(jsonNode)) {
              List<JSONChild> children = getChildren(jsonNode);
  
              for (JSONChild child : children) {
                  addNode(newNode, child.getName(), child.getBody());
              }
          }
  
          return newNode;
      }