I think this is defined at ExtendScript level, along with things like the XML object and not part of the InDesign DOM API.
You could do a doScript into ExtendScript, create an instance there and return the string.
IMO looking purely from a API perspective the UXP side of things is quite a downgrade to ExtendScript, it is slower and misses very useful/needed features that were part of ExtendScript for ages (resolving specifiers, persistent engine, global helper objects).
Thankfully the doscript is available with the option to do (serious) stuff in ExtendScript still from a UXP plugin. Best of both worlds I suppose…