def pprint(xml_str):
    tree = etree.fromstring(xml_str)
    pretty_print(tree)
    return etree.tostring(tree)