Conceptual hydrological models and deep learning models are frequently framed as contrasting and complementary paradigms. The former are transparent and physically interpretable but constrained by prior functional assumptions, whereas the latter are expressive but often lack physical constraints and interpretability. Taking the three-source Xinanjiang (XAJ) model as a case study, this paper develops and validates a structure-compilation route in which each operation of a white-box computational program is systematically rewritten as a computational-graph node composed of affine transformations and element-wise activations. The resulting model is a recurrent neural network (RNN) whose weights are manually specified and whose outputs are bitwise equivalent to the original program at floating-point machine precision. Four general conversion rules are proposed: (i) min/max operations as ReLU combinations; (ii) power-law curves as Pow activations; (iii) conditional branches through closed-form elimination or hard-threshold activation with value-range selection; and (iv) temporal recursion as a weight-shared RNN. The XAJ model is compiled into a network cell containing 93 nodes and 117 weighted edges (63 affine nodes, 25 ReLU nodes, one Step node, and four power activations). In a 1400-day synthetic catchment experiment, the maximum output deviation between the compiled network and the classical if/else implementation is 2.84 × 10-13 m3/s, and the cross-computed NSE is 1.000000000000000. Furthermore, a total of 11 physical parameters are unfrozen as trainable weights through log/sigmoid transformations and calibrated by Limited-memory Broyden-Fletcher-Goldfarb-Shanno with Boundary algorithm against observations containing 7% multiplicative noise. After 150 iterations, the validation-period NSE increased from 0.510 to 0.991 (calibration period: 0.598 to 0.994), essentially reaching the theoretical noise ceiling of approximately 0.995 implied by the 7% multiplicative observation noise. Five of the 11 parameters (the evapotranspiration coefficient K, the tension-water capacity WM, the curve exponent B, the free-water capacity SM and the groundwater recession constant CG) were recovered within 5%, whereas the routing and evapotranspiration parameters deviate by 5-27% owing to parameter equifinality. Nevertheless, the trained weights can be written back directly into the hand-wired network. These results indicate that the same architecture behaves as a deterministic hydrological model when weights are frozen and as a gradient-trainable neural network when weights are unfrozen. The approach is further compared with purely black-box deep learning, traditional white-box modelling, physics-informed neural networks (PINNs) in terms of inductive bias, data efficiency, interpretability, differentiability, and engineering feasibility. Potential applications in coupled data assimilation, parameter regionalization, large-sample parallel forecasting, and physics-data hybrid modelling are discussed.