Abundances in intermediate-mass AGB stars undergoing third dredge-up and hot-bottom burning