public static int parseXmlFeedFile(BufferedReader reader, int maxDocuments, Consumer<Predicate> consumer) throws IOException {
        int documentCount = 0;
        reader.readLine();
        String line = reader.readLine(); // Skip to start of first document
        while (! line.startsWith("</vespafeed>") && documentCount < maxDocuments) {
            while (!line.startsWith("<boolean>")) {
                line = reader.readLine();
            }
            Predicate predicate = Predicate.fromString(extractBooleanExpressionXml(line)); consumer.accept(predicate);
            ++ documentCount;
            while (! line.startsWith("<document") && ! line.startsWith("</vespafeed>")) {
                line = reader.readLine();
            }
            line = reader.readLine();
            if (line == null) break;
        }
        return documentCount;
    }
Parses a feed file containing documents in JSON format. Its implementation is based on the following assumptions:
 1. Each document has single predicate field.
 2. The predicate is stored in a field named "boolean".
 3. There is just one "boolean" field on each line

 @author bjorncs
predicate-search/src/main/java/com/yahoo/search/predicate/utils/VespaFeedParser.java