class MatchingArchivedMessageResults {

    public List<Stanza> toStanzas() {
        List<Stanza> stanzas = new ArrayList<>();
        archivedMessages.list().stream().map(archivedMessage -> new MatchingArchivedMessageResult(initiatingEntity,
                archiveId, query, archivedMessage)).map(MatchingArchivedMessageResult::toStanza).forEach(stanzas::add);
        stanzas.add(buildResultIq());
        return stanzas;
    }

    public  MatchingArchivedMessageResults(Entity initiatingEntity, Entity archiveId, Query query,
            ArchivedMessages archivedMessages);

}