Inner XML/opendocument needed clean-up

I’d like to back up a series of questions from the past that haven’t had any results yet.
See “Clean up .odt file?”.

Note: the examples below have been modified and saved in LO Writer

  • Version: 25.8.2.2 (X86_64)*
  • Build ID: d401f2107ccab8f924a8e2df40f573aab7605b6f*
  • CPU threads: 12; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win*
  • Locale: it-IT (it_IT); UI: en-US*
  • Calc: threaded*
    and later reopened as read-only XML

The funny XML I found in some of my documents is a motivation. Take this example:

<text:p text:style-name="Text_20_body">
Note that ... It may become a repeatable loop
<text:span text:style-name="T9">in these cases</text:span>
:
</text:p>

The words “in these cases” above have no special formatting. Actually, in the original, I had a single word uselessly formatted, “those”, which appeared split like this nonsense

th
<text:span text:style-name="T9">os</text:span>
e

Trying to change and understand it, I eventually had to delete the entire sequence in the phrase to see that useless formatting disappear.
But as I reopened the document and typed anew “in these cases” I ended up seeing again that formatting reappearing around them!

There’s something seriously broken in this behavior.

[EDIT]
Find attached a sample document of the madness above
formatting.odt (11.6 KB)

But in general, unless one needs to use FODT together with an external versioning system, what is the problem with that (and here you use ODT, so not plain XML)?

A name like "T9" denotes direct formatting. But you, as a user, are not the sole responsible for direct formatting. Writer adds its own annotations to improve change tracking and comparison.

This special form of annotation is controlled by Tools>Options, LO Writer>Comparison Random number to improve accuracy of document comparison. Untick the check boxes to stop annotating.

Unfortunately, it does nothing on existing mark up.

… but one can get rid of those existing ones by saving to ODF strict (not extended) once.

Where is the setting to save “ODF strict”?
[EDIT]
Found, in the Load/Save options as non-“Extended”, I guess

As a late answer, the problem arose when I wondered if XML could help me with some other hard-to-understand troubles.

TL;DR
I have a few documents converted from DOC format and/or with parts copied from such format. They ended to be a mayhem.
One had many hidden tables (?) that I don’t know what they were or why. Then it had a few ghost tables: I saved the document OK, exported to PDF, fine. Then I reopened it and some empty tables reappeared in my text, sometimes just a bunch of empty lines that weren’t deletable - no menu option to delete the rows I selected, I had to delete the entire table and restart anew.
Saving things and restarting resulted (from time to time) in reappearing ghost tables!
The only solution I’ve found so far is a lengthy copy and paste into a new document.