Does Facebook have a function to "clean" the profile, meaning delete for example all posts (or all older than 5 years), but keep the friendlist? Something like "delete your profile", but only for parts of it, so that one could delete all these 7 years old posts (or all of them altogether), while keeping the friendlist and profile pictures.
No, as of now this kind of function is not available.
The only option to delete is one post at a time either using the dropdown menu for a post on your Timeline (click the 'V' in the upper right corner of the post) or in your Activity Log click the pencil icon to the right of an item.
If you want delete old posts you can select year, then it will show all posts of that year and you can delete one by one.
If you go to your profile you will see year list in right hand side.