def fixup_unqualified_attributes(tree, namespace):
    """
    Fix unqualified attributes in the `tree` to be `namespace` prefixed.

    :param tree: The tree to process.
    :type tree: xml.etree.ElementTree.ElementTree
    :param namespace: The namespace (sans braces) to add.
    :type namespace: str
    :return: The processed tree, modified in-place
    :rtype: xml.etree.ElementTree.ElementTree
    """
    for elem in tree.iter():
        for key in [key for key in elem.keys() if key[0] != '{']:
            elem.attrib['{%s}%s' % (namespace, key)] = elem.attrib.pop(key)
    return tree