> and I create my own 'getSortedElements' which calls my callback and use cSort?

your 'get elements' method won't call the callback, your implementation of IGetElementsForPaging will get elements and sort if necessary, 

So something like:

CQuerySetPager : implements IGetElementsForPaging
{
// IGetElementsForPaging impl.
    virtual void getElements(IArray )
    {
        Owned<IPropertyTree> fileTree = getAllQuerySetQueries(conn, namefilterlo, xpath);
        ...
        cSort sort;
        if (sortorder&&*sortorder)
            sort.dosort(*iter,sortorder,namefilterlo,namefilterhi,results);
        ...
    }
};