code: private static void escapeXml(final String text, final Writer writer, final XmlEscapeSymbols symbols,
                                    final XmlEscapeType type, final XmlEscapeLevel level)
              throws IOException {
  
          if (writer == null) {
              throw new IllegalArgumentException("Argument 'writer' cannot be null");
          }
  
          if (type == null) {
              throw new IllegalArgumentException("The 'type' argument cannot be null");
          }
  
          if (level == null) {
              throw new IllegalArgumentException("The 'level' argument cannot be null");
          }
  
          XmlEscapeUtil.escape(new InternalStringReader(text), writer, 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.