The present invention relates to polypeptides having xylanase activity, catalytic domains, and carbohydrate binding domains, and polynucleotides encoding the polypeptides, catalytic domains, and carbohydrate binding domains. The present invention also relates to nucleic acid constructs, vectors, and host cells comprising the polynucleotides as well as methods of producing and using the polypeptides, catalytic domains, and carbohydrate binding domains.