Ah, so you're inferring from their xml format? MathML fits in a DOM tree perfectly well, and keeping source tex as an attribute (to present to the user and re-parse into MathML after edits) on the top level node of the MathML isn't challenging.
Their file format's their own business, and outside of a hierarchical node structure, doesn't speak too much about in-memory representation.
Math is everywhere and a note taking app should support it. It's painfully behind other systems (obsidian, notion, roam, etc) here.