def read_settings(template_xml):
    """
    Read the memory settings from the template file
    """
    rv = dict()
    for template in template_xml.findall('server-template'):
        for server in template.findall('server'):
            for option in server.findall('option'):
                o = option.text
                if o.startswith('-Xmx') | o.startswith('-XX'):
                    rv.setdefault(server.get('id'), []).append(o)
    return rv
