code: private void scanThroughFilesForNextJournalEntry() throws JournalException {
          try {
              while (true) {
                  if (currentFile != null) {
                      // Check to see whether the current file contains any more
                      // entries. 
                      advancePastWhitespace(currentFile.getReader());
  
                      XMLEvent next = currentFile.getReader().peek();
                      if (isStartTagEvent(next, QNAME_TAG_JOURNAL_ENTRY)) {
                          // found it
                          return;
                      } else if (isEndTagEvent(next, QNAME_TAG_JOURNAL)) {
                          // need to get the next file
                          closeCurrentFile();
                      } else {
                          // problems
                          throw getNotNextMemberOrEndOfGroupException(QNAME_TAG_JOURNAL,
                                                                      QNAME_TAG_JOURNAL_ENTRY,
                                                                      next);
                      }
                  }
  
                  // If we don't have a file open, try to open one.
                  if (currentFile == null) {
                      currentFile = openNextFile();
                  }
  
                  // If we still don't have a file open, we're finished.
                  if (currentFile == null) {
                      // if there was no next file, we're done.
                      return;
                  }
  
                  // A new file needs to be advanced before using.
                  advanceIntoFile(currentFile.getReader());
              }
          } catch (XMLStreamException e) {
              throw new JournalException(e);
          }
      }
docs: Advance to the next journal entry if there is one. If we find one, the
  current file will be pointing to it. If we don't find one, there will be
  no current file.