The invention relates to a nucleic acid molecule encoding (I) a polypeptide having the activity of a beta-galactosidase (EC 3.2.1.23), which is (a) a nucleic acid molecule encoding a polypeptide comprising or consisting of the amino acid sequence of SEQ ID NO: 1 (b) a nucleic acid molecule comprising or consisting of the nucleotide sequence of SEQ ID NO: 2 (c) a nucleic acid molecule encoding a beta-galactosidase the amino acid sequence of which is at least 64% identical to the amino acid sequence of SEQ ID NO: 1, (d) a nucleic acid molecule comprising or consisting of a nucleotide sequence which is at least 63% identical to the nucleotide sequence of SEQ ID NO: 2, (e) a nucleic acid molecule which is degenerate with respect to the nucleic acid molecule of (d) or (f) a nucleic acid molecule corresponding to the nucleic acid molecule of any one of (a) to (e) wherein T is replaced by U (II) a fragment of the polypeptide of (I) having the activity of a beta-galactosidase.