And if anyone is interested, we have added an xhtml pretty routine to our sigil_bs4 fork.
Code:
def prettyprint_xhtml(self, indent_level=0, eventual_encoding=DEFAULT_OUTPUT_ENCODING,
formatter="minimal", indent_chars=" ")
So it would be relatively easy to "pretty print" serialize a xhtml file once parsed in sigil_bs4 if desired in the plugin. Otherwise runnng prettify inside Sigil globally is easy too after the plugin completes (or use automate).