code: public void parseFile(File file) throws ParserException, IOException {
  
          Reader reader = null;
  
          try {
              reader = new FileReader(file);
              nanoElement.parseFromReader(reader);
          } catch (XMLParseException e) {
              throw new ParserException(e.getMessage());
          } finally {
              if (reader != null) reader.close();
          }
      }
docs: Parse a XML file.
  
  @param file The XML file.
  
  @throws ParserException
  If an error is occurred while parsing the
  read data.
  @throws IOException
  If an I/O error is occurred.