import copy


def make_all_strokes_dashed(svg, unfilled=False):
    """
    Makes all strokes in the SVG dashed
    :param svg: The SVG, in xml.etree.ElementTree format
    :param unfilled: Whether this is an unfilled symbol
    :return: The resulting SVG
    """
    stroke_elements = [ele for ele in svg.findall('.//*[@stroke]') if ele.attrib['stroke'] != 'none']

    if not unfilled:
        stroke_elements_with_dash = [copy.deepcopy(ele) for ele in stroke_elements]

        for ele in stroke_elements:
            ele.attrib['stroke'] = '#ffffff'
        for ele in stroke_elements_with_dash:
            ele.attrib['stroke-dasharray'] = '2 2'

        svg.extend(stroke_elements_with_dash)
    else:
        for ele in stroke_elements:
            ele.attrib['stroke-dasharray'] = '2 2'

    return svg