public override XmlModel GetXmlModel(Uri source)
        {
            SimpleXmlModel model;
            if (!_models.TryGetValue(source, out model))
            {
                var doc = Build(source);
                model = _models[source] = new SimpleXmlModel(source, doc);
            }

            return model;
        }
 internal void LockForWrite(SimpleXmlModel doc)
 {
     Lock(doc, LockMode.Write);
 }
 private void Lock(SimpleXmlModel doc, LockMode mode)
 {
     if (Status == XmlTransactionStatus.Active)
     {
         if (mode == LockMode.Write)
         {
             manager.SimpleLockManager.LockForWrite(this, doc);
             EnlistResource(doc);
         }
         else
         {
             manager.SimpleLockManager.LockForRead(this, doc);
         }
     }
 }
 internal void EnlistResource(SimpleXmlModel model)
 {
     var doc = model.Document;
     resources.Add(doc, new SimpleTransactionLogger(doc, this));
 }