}         // func GetDataFromStream

        /// <summary>Pull dataset from the object.</summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        protected override PpsDataSetServer PullData(PpsObjectAccess obj)
        {
            // get the head or given revision
            // create the dataset
            var data = (PpsDataSetServer)DataSetDefinition.CreateDataSet();

            if (obj.HeadRevId > 0)
            {
                var xDocumentData = XDocument.Parse(obj.GetText());
                data.Read(xDocumentData.Root);
            }
            else
            {
                CallTableMethods(LuaOnCreateRevision, obj, data);
            }

            // correct id and revision
            CheckHeadObjectId(obj, data);

            // fire triggers
            CallTableMethods(LuaOnAfterPull, obj, data);

            // mark all has orignal
            data.Commit();

            return(data);
        }         // func PullData
        }         // proc WriteDataToStream

        /// <summary>Parse dataset from the input stream.</summary>
        /// <param name="src"></param>
        /// <returns></returns>
        protected override PpsDataSetServer GetDataFromStream(Stream src)
        {
            var data = (PpsDataSetServer)DataSetDefinition.CreateDataSet();

            using (var xml = XmlReader.Create(src, Procs.XmlReaderSettings))
                data.Read(XDocument.Load(xml).Root);
            return(data);
        }         // func GetDataFromStream