I am trying to print XML out of an Element object, so that formatting allows us to print the tag attributes in new line.
elem = etree.Element() //Some element
str = etree.tostring(elem, pretty_print=True)
The current output looks like
<module name="A" description="abc" type="xyz">
<container/>
</module>
Formatting needed
<module
name="A"
description="abc"
type="xyz">
<container/>
</module>
Is there any existing library that allows us to print newlines for all the attributes present in the tags.