code: public static void main(String[] args) throws Exception {
      if (args[0].equals("-readDoc")) {
        Document doc = readDocumentFromFile(args[1]);
        System.out.println(doc);
      } else {
        String s = IOUtils.slurpFile(args[0]);
        Reader r = new StringReader(s);
        String tag = readTag(r);
        while (tag.length() > 0) {
          readUntilTag(r);
          tag = readTag(r);
          if (tag.length() == 0) {
            break;
          }
          System.out.println("got tag=" + new XMLTag(tag));
        }
      }
    }
docs: Tests a few methods.
  If the first arg is -readDoc then this method tests
  readDocumentFromFile.
  Otherwise, it tests readTag/readUntilTag and slurpFile.