A common suggestion has been to tweak the XML (with Perl or Grep).
Do the Import modules track the line number of the data file being imported?
If so, can you recommend a standard Gramps debugging line to insert to print the line number of the XML/gpkg file that caused a parsing error?
(Are there any ‘smart’ debugging options? Where the print line is skipped if Gramps isn’t in a debug mode? Or where only the 1st x number of instances are reported to avoid a 30,000 line bebug report.)