XDXF: Fix infinite loop for malformed files. (Issue #319)