Since _warn() is called from two different places (warn_if_markup_looks_like_xml and _root_tag_encountered) it probably needs a different stacklevel at each place. And warn_if_markup_looks_like_xml is potentially called at a different place by each TreeBuilder.
Since _warn() is called from two different places (warn_if_ markup_ looks_like_ xml and _root_tag_ encountered) it probably needs a different stacklevel at each place. And warn_if_ markup_ looks_like_ xml is potentially called at a different place by each TreeBuilder.