  We study the interaction of a heteronuclear diatomic molecule, carbon
monoxide, with a free-electron laser (FEL) pulse. We compute the ion yields and
the intermediate states by which the ion yields are populated. We do so using
rate equations, computing all relevant molecular and atomic photoionisation
cross-sections and Auger rates. We find that the charge distribution of the
carbon and oxygen ion yields differ. By varying the photon energy, we
demonstrate how to control higher-charged states being populated mostly by
carbon or oxygen. Moreover, we identify the differences in the resulting ion
yields and pathways populating these yields between a homonuclear molecule,
molecular nitrogen, and a heteronuclear molecule, carbon monoxide, interacting
with an FEL pulse. These two molecules have similar electronic structure. We
also identify the proportion of each ion yield which accesses a two-site
double-core-hole state and tailor pulse parameters to maximise this proportion.
