Changing the default indentation of etree.tostring in lxml
Changing the default indentation of etree.tostring in lxml Question: I have an XML document which I’m pretty-printing using lxml.etree.tostring print etree.tostring(doc, pretty_print=True) The default level of indentation is 2 spaces, and I’d like to change this to 4 spaces. There isn’t any argument for this in the tostring function; is there a way to do …