The sentence is grammatically correct, Jackson, and completely in accordance with English grammatical rules and practices.
To have been written is a passive perfect infinitive. There are only two infinitives in English and they can be used in both active and passive. As a rule, the present infintive refers to the present and the future and the perfect infinitive refers to the past:
Active,
present infinitive:
I would write it down.
He may come tomorrow.
I want to say something.
It's easy to speak English.
Passive, present infinitive:It should be written down.
He won't be caught.
To be seen is not the same as to be caught.
Active,
perfect infintive:
I would have written it down.
To have loved and lost is better than never to have loved at all.Passive, perfect infinitive:
It was thought to have been written by Michael.
Something should have been done earlier.
They may have been seen at the station.CB