Theory of composite BxCyNz nanotube heterojunctions