We have an XML tree which stores the relationship between folders and video files. So each folder could be the artists name and below it we have the videos of the artist. Also each folder can have other sub folders.

This tree structure can be accessed by multiple users where some users could be deleting videos, others moving videos between folders and others possibly renaming folders.

What I need is a mechanism where I lock parts of the tree when one user is working on it and when multiple users all work on their parts of the tree, when they make their changes, the tree is not corrupted. Is this possible to implement when using XML?

  • Where do you store the XML tree you want to modify? (main memory, file, database,...)
    – Bernd
    Commented Feb 9, 2012 at 13:47

1 Answer 1


You will need control over all of the code that is accessing the XML. There is nothing inherently built into XML that XML editors, text editors and other programs will respect as a locking feature.

If you control the code, there are a number of ways to go. The easiest way is probably to add a "LockedBy" attribute to the XML node you want to lock.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.