Machine Learning-based Unfolding for Cross Section Measurements in the Presence of Nuisance Parameters