I came from the TeX-Approach where all layout elements are boxes which contain other boxes. This box-tree is a kind of DOM if you want. But the box-tree only represents the layout, not the data itself. For the data you usually have a separate object. In Word this used to be the piece table structure, now it is probably something else. I described my approach here, if you want to know how and why: https://codeberg.org/chrisecker/texeltree/src/branch/main/do...