code: private static String escapeXml(final String text, final XmlEscapeSymbols symbols,
                                      final XmlEscapeType type, final XmlEscapeLevel level) {
  
          if (type == null) {
              throw new IllegalArgumentException("The 'type' argument cannot be null");
          }
  
          if (level == null) {
              throw new IllegalArgumentException("The 'level' argument cannot be null");
          }
  
          return XmlEscapeUtil.escape(text, symbols, type, level);
  
      }
docs: /*
  Private escape method called from XML 1.0 and XML 1.1 public methods, once the correct
  symbol set has been selected.