  It is commonly adopted that X-rays from O stars are produced deep inside the
stellar wind, and transported outwards through the bulk of the expanding matter
which attenuates the radiation and affects the shape of emission line profiles.
None of the existing models was able to fit the observationed lines
consistently. The possible caveat of these models was the assumption of a
smooth stellar wind. Motivated by the various evidences that the stellar winds
are in fact structured, we present a 2-D numerical model of a stochastic,
inhomogeneous wind. Small parcels of hot, X-ray emitting gas are permeated with
cool, absorbing wind material which is compressed into thin shell fragments.
Wind fragmentation alters the radiative transfer drastically, compared to
homogeneous models of the same mass-loss rate. X-rays produced deep inside the
wind, which would be totally absorbed in a homogeneous flow, can effectively
escape from a fragmented wind. The wind absorption becomes wavelength
independent if the individual fragments are optically thick. The X-ray line
profiles are flat-topped in the blue part and decline steeply in the red part
for the winds with short acceleration zone. For the winds where the
acceleration extends over significant distances, the lines can appear nearly
symmetric and only slightly blueshifted, in contrast to the skewed, triangular
line profiles typically obtained from homogeneous wind models of high optical
depth. We show that profiles from a fragmented wind model can reproduce the
observed line profiles from zeta Orionis.
