code: public static UNode parse(String text, ContentType contentType) throws IllegalArgumentException {
          UNode result = null;
          if (contentType.isJSON()) {
              result = parseJSON(text);
          } else if (contentType.isXML()) {
              result = parseXML(text);
          } else {
              Utils.require(false, "Unsupported content-type: " + contentType);
          }
          return result;
      }
docs: Parse the given text, formatted with the given content-type, into a UNode tree and
  return the root node.
  
  @param text          Text to be parsed.
  @param contentType   {@link ContentType} of text. Only JSON and XML are supported.
  @return              Root node of parsed node tree.
  @throws IllegalArgumentException  If a parsing error occurs.