Handle EOF in .xcfg parsing correctly

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>