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

The closing tag of the previous element was not read.
Merge pull request #538 from mgavioli/Fix_23521_workspaces_wiith_images

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