The superconducting 1.3-GHz niobium cavities of the XFEL linear accelerator will be cooled in a bath of saturated liquid He II at a temperature of 2 K. The liquid He II supply of the 1.7-km long linac is subdivided in sections of about 150 m length. In these sections a two-phase flow of He II liquid and corresponding vapor occurs. A stable stratified smooth helium flow has to be maintained for the RF operation of the cavities, to avoid any vibrations or microphonic effects. A computer code has been developed to simulate the two-phase flow patterns in the XFEL-linac, based on an existing model. The flow characteristics at different cryogenic loads and helium temperatures have been calculated. The results are shown and the consequences for the design of the XFEL-linac cryogenic system are discussed.