from xml.dom import minidom
import xml.etree.cElementTree as et


def prettify_xml(elem):
    """Return a pretty-printed XML string for the Element.
    """

    rough_string = et.tostring(elem, 'utf-8')
    reparsed = minidom.parseString(rough_string)
    return reparsed.toprettyxml(indent="  ")