code: public static NaaccrData readXmlFile(File xmlFile, NaaccrOptions options, List<NaaccrDictionary> userDictionaries, NaaccrObserver observer) throws NaaccrIOException {
          if (xmlFile == null)
              throw new NaaccrIOException("Source XML file is required");
          if (!xmlFile.exists())
              throw new NaaccrIOException("Source XML file must exist");
  
          try (PatientXmlReader reader = new PatientXmlReader(createReader(xmlFile), options, userDictionaries)) {
              NaaccrData rootData = reader.getRootData();
              Patient patient = reader.readPatient();
              while (patient != null && !Thread.currentThread().isInterrupted()) {
                  if (observer != null)
                      observer.patientRead(patient);
                  rootData.addPatient(patient);
                  patient = reader.readPatient();
              }
              return rootData;
          }
      }
docs: Reads an NAACCR XML data file and returns the corresponding data.
  <br/>
  ATTENTION: THIS METHOD WILL RETURN THE FULL CONTENT OF THE FILE AND IS NOT SUITABLE FOR LARGE FILE; CONSIDER USING A STREAM INSTEAD.
  @param xmlFile source XML data file, must exists
  @param options optional validating options
  @param userDictionaries optional user-defined dictionaries (will be merged with the base dictionary)
  @param observer an optional observer, useful to keep track of the progress
  @throws NaaccrIOException if there is problem reading/writing the file