code: private void disableExternalResourceFetching(XMLReader reader) throws SAXNotRecognizedException, SAXNotSupportedException {
          reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
          reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
          reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",false);
      }
docs: Disables certain dangerous features that attempt to automatically fetch DTDs
  
  See <a href="https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet#XMLReader">OWASP XXE Cheat Sheet</a>
  @param reader the reader to disable the features on
  @throws SAXNotRecognizedException
  @throws SAXNotSupportedException