Serialize to XHTML (e.g. br, hr)

Is it possible to let ProseMirror to output XHTML? I’ve looked at one of the introductory examples and there I see <hr>. I’m wondering whether I can make this a self closing tag: <hr/>

The DOMSerializer outputs a DOM tree, not HTML. It shouldn’t be too hard to run a function over that that produces an XHTML string.

Thanks for the follow up. Let me also check tiptap which I believe have a dedicated function for that.