Each time a users visits my web site pages, several xml elements are written and removed from one predefined file.
Eventually there will be a situation, when on this same file a read and write operation will take place almost simultaniously. How do I handle concurrency in this case? Is there a special base class library class that can handle it for me?
XML files will not do this for you. You could set up a synchronizing object: the simplest would be to have a common function that accesses the file and use the lock key word. Use a Mutex for inter-process synchronization.
However, this will be a potential bottle neck.
It may be time to start using a database.