MediaWiki has two PHP classes that can be used for building HTML markup for browsers: Html, and Xml. Some methods are very similar between the two (e.g. Html::element( 'x', [ 'y' => 1 ], 'z' ) === Xml::element( 'x', [ 'y' => 1 ], 'z' )), though the Xml versions sometimes have fewer features (e.g. only Html supports 'class' => [ 'foo', 'bar' ] attribute array values). Some methods are only available in one of the two classes, possibly for no good reason other than historical accident. (For instance, fieldset() is only in Xml, while hidden() is only in Html.)
This is generally confusing, no longer necessary since the HTML5ication of MediaWiki years ago, and occasionally leads to bugs (e.g. T341566). We should stop using the Xml methods that are used for building HTML (as opposed to the ones for general-purpose XML, for example in Special:Export or RSS, which of course should be kept). Some methods may need to be copied to Html if they’re not available there yet.
A codesearch for Xml:: reveals 218 files across 38 repos.