public static void main(String[] args) throws Exception {
      String inFile  = args[0];
      String outFile = args[1];
      boolean append = "append".equals(args[2]);

      // load file and instantiate class. File may use any valid
      // BOM marker bytes at the start. System default charset is
      // used if marker is not found.
      TestXML test = new TestXML( new String(FileUtil.loadFile(inFile)) );

      StringBuffer sb = new StringBuffer();
      sb.append("File: " + inFile);
      sb.append("\r\n");
 
      for(int i=1; i <= 20; i++) {
         String value = test.getText("/note/body" + i);
         if (value != null) {
            sb.append(value);
            sb.append("\r\n");
         }
      }
      sb.append("\r\n");

      // save UTF-8 text file with BOM marker bytes
      FileUtil.saveFile(outFile, sb.toString(), append);
   }