Although the Princess was very unhappy at leaving her husband , she did not like to refuse the invitation , and , promising to return in seven days at the latest , she took a tender farewell of the Prince , and said : ` Before I go I will hand you over all the keys of the castle .