It dates to the late 11th century and was used as a monastic and royal treasury