'Sign multiple parts of a statement
:param statement: The statement that should be sign, this is XML text
:param to_sign: A list of (items, id, id attribute name) tuples that
specifies what to sign
:param key: A key that should be used for doing the signing
:param key_file: A file that contains the key to be used
:return: A possibly multiple signed statement'

def multiple_signatures(self, statement, to_sign, key=None, key_file=None, passphrase=None):

    for (item, sid, id_attr) in to_sign:
        if (not sid):
            if (not item.id):
                sid = item.id = sid()
            else:
                sid = item.id
        if (not item.signature):
            item.signature = pre_signature_part(sid, self.cert_file)
        statement = self.sign_statement(statement, class_name(item), key=key, key_file=key_file, node_id=sid, id_attr=id_attr, passphrase=passphrase)
    return statement
