We consider a model of a stationary population with random size given by a continuous-state branching process with immigration with a quadratic branching mechanism. We give an exact elementary simulation procedure for the genealogical tree of n individuals randomly chosen among the extant population at a given time. Then we prove the convergence of the renormalized total length of this genealogical tree as n goes to infinity; see also Pfaffelhuber, Wakolbinger and Weisshaupt (2011) in the context of a constant-size population. The limit appears already in Bi and Delmas (2016) but with a different approximation of the full genealogical tree. The proof is based on the ancestral process of the extant population at a fixed time, which was defined by Aldous and Popovic (2005) in the critical case.