Fix #23521 : reading a workspace containing <file> tags crashes

Fix #23521 : reading a workspace containing <file> tags crashes

The closing tag of the previous element was not read.