The invention relates to a process of producing a xylose solution from a biomass hydrolysate by subjecting the biomass hydrolysate to nanofiltration and recovering as the nanofiltration permeate a solution enriched in xylose. The biomass hydrolysate used as starting material is typically a spent liquor obtained from a pulping process.