This paper investigates the two-way relay transmission over orthogonal frequency division multiplexing (OFDM) channels using digital network coding. For a given amount of data to be transmitted, we formulate an optimization problem to minimize the total transmission completion time by jointly allocating the power and assigning the subcarriers under individual power constraints. Due to the difficulty to derive the explicit solution to this optimization problem, we decompose it into two subproblems. Then, we design suboptimal algorithms with low complexity for the two subproblems, where subcarriers are assigned firstly and then the power is optimally allocated over the assigned subcarriers. The end-to-end delay is adopted to evaluate the system in a systematic view. Simulation results show that our proposed scheme achieves less than 1.06 times the minimal total transmission completion time achieved by exhaustive search for two-way relay OFDM systems and outperforms non-network coding schemes with a probability over 90%. Moreover, the corresponding distribution regions with performance gain are also discussed by simulations, which may give some insights in the application of network coding in OFDM systems.