This study examines enzymatic production of linear xylooligosaccharides (XOS) and branched arabinoxylooligosaccharides (AXOS) from monocotyledonous biomass, wheat straw and ryegrass, and compares the in vitro effects of these XOS and AXOS on pig gut microbiota. XOS and AXOS were obtained from the biomass by treatment with different endo-1,4-β-xylanases. XOS of DP2-6 from wheat straw, obtained after treatment with Aspergillus niger endo GH11, suppressed growth of Clostridium perfringens and resulted in a high level of lactic acid production when fermented in vitro by pig fecal microbiota. Analogously, XOS ryegrass produced in the same way also suppressed Cl. perfringens growth, and more so than the corresponding ryegrass AXOS, but AXOS exhibited a more pronounced stimulation of lactic acid bacteria growth than XOS. The prebiotic potential, i.e., suppression of Cl. perfringens and stimulation of lactic acid bacteria, for the ryegrass oligosaccharides was as follows: XOS, produced by A. niger endo-1,4-β-xylanase (GH 11) ≥ AXOS, produced by Thermotoga maritima and Cellvibrio mixtus endo-1,4-β-xylanase s (GH10) > AXOS, produced by Trichoderma viride and Aspergillus aculeatus endo-1,4-β-xylanase s (GH11). These results indicate that wheat straw as well as green grass biomass such as ryegrass have potential as new sources of putative prebiotics for pig feed.