<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reformat_to_pretty_xml(doc_xml):
 """Pretty print XML doc. Args: doc_xml : str Well formed XML doc Returns: str: Pretty printed XML doc """

    assert isinstance(doc_xml, str)
    dom_obj = xml.dom.minidom.parseString(doc_xml)
    pretty_xml = dom_obj.toprettyxml(indent='  ')
    # Remove empty lines in the result caused by a bug in toprettyxml()
    return re.sub(r'^\s*$\n', r'', pretty_xml, flags=re.MULTILINE)