It's qcompress: outfile.write( qCompress( xml.toUtf8() ) );
To get an mmp from mmpz as a user you go:
lmms --dump myproject.mmpz > myproject.mmp
I think the part, codevise, you're looking for is:
https://github.com/LMMS/lmms/blob/c1321 ... #L292:L297