Hemicelluloses, a family of heterogeneous polysaccharides with complex molecular structures, constitute a fundamental component of lignocellulosic biomass. However, the contribution of each hemicellulose type to the mechanical properties of secondary plant cell walls remains elusive. Here we homogeneously incorporate different combinations of extracted and purified hemicelluloses (xylans and glucomannans) from softwood and hardwood species into self-assembled networks during cellulose biosynthesis in a bacterial model, without altering the morphology and the crystallinity of the cellulose bundles. These composite hydrogels can be therefore envisioned as models of secondary plant cell walls prior to lignification. The incorporated hemicelluloses exhibit both a rigid phase having close interactions with cellulose, together with a flexible phase contributing to the multiscale architecture of the bacterial cellulose hydrogels. The wood hemicelluloses exhibit distinct biomechanical contributions, with glucomannans increasing the elastic modulus in compression, and xylans contributing to a dramatic increase of the elongation at break under tension. These diverging effects cannot be explained solely from the nature of their direct interactions with cellulose, but can be related to the distinct molecular structure of wood xylans and mannans, the multiphase architecture of the hydrogels and the aggregative effects amongst hemicellulose-coated fibrils. Our study contributes to understanding the specific roles of wood xylans and glucomannans in the biomechanical integrity of secondary cell walls in tension and compression and has significance for the development of lignocellulosic materials with controlled assembly and tailored mechanical properties.