I'm cleaning up some gross XML, and so I've had pretty_print = True set in the call to etree.tostring() on my lxml output of the XSL transform. However, that left me with a few junk whitespace nodes from the original input, so I added
<xsl:strip-space elements="*"/>
...but that completely collapses all whitespace, ignoring pretty print. Is there an easy way to make strip-space just apply to the input, and still get lxml to apply pretty print?