Construction of a model of an X-ray illuminated cloud consists of the simultaneous solution of the local balance equations. The radiative transfer equation is solved for both the continuum and for the lines that escape the region near the point of emission. The large number of ions in the calculation results in many ionization edges that may affect the radiation field. We solve the transfer equation on a frequency grid that includes a total of 9999 continuum grid points with even logarithmic spacing in energy from 0.1 eV to 20 keV resulting in a limiting resolution of 0.12 , corresponding to, e.g. 8.6 eV at 7 keV. We calculate the luminosities of 10000 spectral lines and solve the continuum transfer equation individually for each of these. The emissivity of each line at each point is the product of the emissivity and the local escape fraction for that line. The continuum opacity for each line is the opacity calculated for the energy bin that contains the line. This procedure is repeated for each successive shell with increasing radius.

Calculation of the escape of the diffuse radiation field depends on a knowledge of the optical depths of the cloud from any point to both the inner and outer boundaries. Since these are not known a priori we iteratively calculate the cloud structure by stepping through the radial shells at least 3 times. For the initial pass through the shells we assume that the optical depths in the outward direction are zero. This procedure is found to converge satisfactorily within 3-5 passes for most problems of interest. This procedure is tantamount to the ``-iteration'' procedure familiar from stellar atmospheres, and must suffer from the same convergence problems when applied to problems with large optical depths. These problems are reduced in our case by the use of escape probabilities rather than a full integration of the equation of transfer.