Compares clases, sequences, and queries to order them for serialization.
Places sequences first, then classes, then queries. Sequences and
queries are ordered alphabetically by name. Classes are placed in
listing order, in inheritance order within that, and in alphabetical
order within that.