docs: protected String clean(String s) {
  
          // remove control characters
          s = s.replaceAll("[\u0000-\u001f]", "");
  
          // escape XML characters
          try {
              Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
              Text text = document.createTextNode(s);
              Transformer transformer = TransformerFactory.newInstance().newTransformer();
              DOMSource source = new DOMSource(text);
              StringWriter writer = new StringWriter();
              StreamResult result = new StreamResult(writer);
              transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
              transformer.transform(source, result);
              return writer.toString();
          } catch (ParserConfigurationException | TransformerException | TransformerFactoryConfigurationError e) {
              return s;
          }
      }