The DBElementCollection class can be used to iterate through the database hierarchy. The iterator is created with a root element and an optional filter. There are then methods to step through the hierarchy and return the element at the current location.