<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def prettify_xml(xml_str):
 """ returns prettified XML without blank lines based on http://stackoverflow.com/questions/14479656/ :param xml_str: the XML to be prettified :type xml_str: str :return: the prettified XML :rtype: str """

    parsed_xml = parseString(get_string(xml_str))
    pretty_xml = '\n'.join(
        [line for line in parsed_xml.toprettyxml(indent=' ' * 2)
         .split('\n') if line.strip()])
    if not pretty_xml.endswith('\n'):
        pretty_xml += '\n'
    return pretty_xml