To expand all items to the next level, either choose Select All (⌘A) and then hit the right arrow key (→), or choose View ▶ Expand All (⇧⌘→). For example, expanding once will show all albums, and expanding again will show all songs.
To collapse all items, either choose Select All (⌘A) and then hit the left arrow key (←), or choose View ▶ Collapse All (⇧⌘←). For example, collapsing once will show just genres.