Function getElementsSortedByZIndex

Sorts a list of DucElements by their z-index (lowest first).