We study a generalization of higher gauge theory which makes use of generalized geometry and seems to be closely related to double field theory. The local kinematical data of this theory is captured by morphisms of graded manifolds between the canonical exact Courant Lie 2-algebroid $TM\oplus T^*M$ over some manifold $M$ and a semistrict gauge Lie 2-algebra. We discuss generalized curvatures and their infinitesimal gauge transformations. Finite gauge transformation as well as global kinematical data are then obtained from principal 2-bundles over 2-spaces. As dynamical principle, we consider first the canonical Chern-Simons action for such a gauge theory. We then show that a previously proposed 3-Lie algebra model for the six-dimensional (2,0) theory is very naturally interpreted as a generalized higher gauge theory.