Sometimes, however, the same document conforms to several overlapping structures, and its processing varies according to the particular structure considered. A Shakespearean play, for example, can be viewed as a structure of acts, each of which is made up of scenes, each of which is in turn composed of speeches and stage directions. But it is also sometimes useful to regard scenes as collections of verse lines. These two views of a scene cannot be fitted into the same hierarchical structure: speeches may contain several lines of verse, but lines of verse can also contain more than one speech. […] As we noted above, this kind of non-hierarchical structure constitutes a problem for an SGML-based encoding system for literary texts: SGML is not designed to accommodate overlapping structural elements.
“Overlap” describes cases where some markup structures do not nest neatly into others, such as when a quotation starts in the middle of one paragraph and ends in the middle of the next.
As a theoretical problem, overlap is an intriguing issue for the markup community generally. For ma[n]y users of the TEI (Text Encoding Initiative) Guidelines (TEIP4), however, it is particularly urgent and more practical. Because TEI users are typically transcribing texts rather than authoring them, they must accurately capture the features of their sources, even if these involve overlapping hierarchies. And since the TEI community so often creates digital texts that must serve a multidisciplinary audience, they must often mark many different types of textual features, which often tend to overlap, in a single text.
two (or more–eek!) encoded textual objects that do not properly nest, i.e. a textual object that starts in one element but ends in another.
The origin of the overlap problem is simply that humanists are trying to represent what they all agree are non-hierarchical structures using a container whose primary structure is a tree. This seems to apply to all markup languages that are embedded in the text, not only those based on XML.