We investigate the buoyancy-driven ventilation of an enclosed volume of buoyant fluid, which is connected to the exterior through two openings at the top of the enclosure. An exchange flow becomes established, with outflow through one opening being matched by an equal and opposite inflow through the other vent. The inflowing flux of dense exterior fluid develops a turbulent buoyant plume, which mixes with the interior fluid as it cascades to the base of the fluid volume. An upward return flow gradually stratifies the confined volume of fluid, with a first front of relatively dense plume fluid advancing to the top of the space. Initially, the exchange flow is steady, but as the first front rises above the inflow opening, the flow rate wanes. The initial development of the exchange flow and interior stratification follows the classical filling box work of Baines & Turner (J. Fluid Mech., vol. 37, 1969, p. 51), with a plume of constant buoyancy flux. Once the first front exits the space, the volume flux rapidly asymptotes to the form Q = Q0(τ/(τ+t)) from the initial value Q0, where τ is the buoyancy-driven draining time, based on the initial density contrast with the environment. The vertical structure of the interior density stratification asymptotes to a profile of constant shape whose amplitude decays in time as (τ/(τ+t))2, and we identify conditions under which the vertical variation in density is comparable to the difference between mean interior density and the exterior. This generalises the analysis presented by Linden, Lane-Serff & Smeed (J. Fluid Mech., vol. 212, 1990, p. 309), who assumed that the interior fluid is well mixed. New laboratory experiments of the process are shown to be consistent with our predictions of the evolution of the flow, the interior stratification and the migration of contaminants. We also develop our analysis for situations where there are multiple stacks and show how this improves the mixing efficiency for a given ventilation flow. The model has relevance for the design of transient mixing ventilation in a building, especially when the effect of vertical stratification is important for ensuring thermal comfort.