Refactor Element:attr_iter_sorted()