private void generateElements(PrintStream out) {
        for (Element element : repository.elements()) {
            if (element instanceof ClassElement) {
                generateNodeDefForClass(out);
                generateClassElement(out, (ClassElement) element);
            }
            else if (element instanceof NoteElement) {
                generateNodeDefForNote(out);
                generateNoteElement(out, (NoteElement) element);
            }
        }

        generateElementsRankHints(out);

        for (Relationship relationship : repository.relations()) {
            generateEdge(out, relationship);
        }
    }