procedure Generic_List_Sorter (List : in out Element_List) is
    type Node;
    type Tree is access Node;
    type Node is
        record  
            Info : Element;
            Left, Right : Tree;
        end record;  
    Root : Tree;
    procedure Place (Item : Element; Where : in out Tree) is
    begin
        if Where = null then
            Where := new Node'(Info => Item, Left | Right => null);
        elsif Where.Info <= Item then
            Place (Item, Where.Right);
        else
            Place (Item, Where.Left);
        end if;
    end Place;  
    procedure Traverse (T : Tree) is
    begin
        if T = null then
            return;
        else
            Traverse (T.Left);
            Append (T.Info, List);
            Traverse (T.Right);
        end if;
    end Traverse;
begin  
    Reset (List);
    while not Done (List) loop
        Place (Value (List), Root);
        Next (List);
    end loop;  
    List := Nil_List;
    Traverse (Root);
end Generic_List_Sorter;