I think I've resolved the issue. Figured I should share what I figured out/did, in case anyone else runs into the same problem.
I started by looking at the incomplete XML being returned in the browser. It started with <record>, then <header>, and inside that was <identifier>, <datestamp> and <setSpec>. <setSpec> was an open tag with no contents, and that was the end of the file. Proceeding on the assumption that there was something wrong with this record, I decided to search for it in the database, using this simple query:
SELECT *
FROM information_object
WHERE information_object.oai_local_identifier = <xxxxxx>
The <xxxxxx> was the identifier number from the incomplete XML. This gave me one row result.
I decided to try the
Delete a Description command from the documentation. To do that, I needed the slug, so I ran another SQL query:
WHERE object_id = <xxxxxx>
This time the <xxxxxx> was the id value from the first query result. This again gave me one row result, including the slug value I needed.
In a PuTTY shell prompt, I ran the command sudo php symfony tools:delete-description <slug> as per the documentation I linked to above, replacing <slug> with the slug value from my second SQL query.
Then I refreshed the browser, and this time it loaded the full page of complete XML. I loaded the next page, using the resumptionToken from the bottom of the page, and the next page gave incomplete XML. I repeated the procedure outlined above. In the end, I had to delete four Descriptions using this procedure. All four were within the same Fonds. After that I received several results pages of correct XML and it looked like it had moved to the next fonds, so I've re-triggered my little PowerShell OAI scraper to see if it can make it to the end successfully (If anyone is interested in that, message me).
One thing I noticed that might be relevant, or maybe a red herring, is that the slugs in the database for the items I deleted did not match exactly the URLs of the corresponding items. For example, the db entry for one description had 'personal-records-6', but the URL ended with 'personal-records-7'. Another one was 'lakehead-university' in the db, but the URL ended with 'lakehead-university-1'.
I hope nobody else runs into this problem, but if anyone does, I hope this helps. Now I just have to hope the problem doesn't return when the archivist re-enters the descriptions I deleted.
David