.xdmf mixed type - problem with generating mesh

And indeed it worked. I have previously seen those answers but i thought that after said process the information about the physical groups would be lost and not passed to the new xdmf file, but apparently it does work as i intended.