as pointed out by cstamas this won't work on windows without first closing the file
NXCM-5302 - Protect against staging.xml corruption