For block-fading Rayleigh channels, this work considers a network coding approach to cooperative transmission. The network under consideration consists of two sources, S and P, that transmit to a common destination, D. Using half-duplex channels, S and P transmit their packets to D; they also overhear each other's transmission. Then both sources cooperate by transmitting a network-coded packet, which is used at D as incrementally redundant information. We first analyze outage probability and show that this scheme achieves full diversity when good quality inter-source channels exist; the result is also verified through simulation. Then, using the outage result we investigate the 'optimal' rate and energy allocations that minimize the outage probability. The results show that the outage-based performance is more sensitive to the energy allocation than to the rate allocation.