public void Unregister(IAdaptable adaptable, string id, XDocument document)
        {
            UnregisterById(adaptable, id, document);
            XElement element = DOMUtils.GetElementById(document, id);

            if (element != null)
            {
                UnregisterByNode(adaptable, element);
            }
        }
        public IAdaptable?GetAdaptable(string id, XDocument document)
        {
            IAdaptable?a = GetAdaptableById(id, document);

            if (a == null)
            {
                XElement element = DOMUtils.GetElementById(document, id);
                if (element != null)
                {
                    a = GetAdaptableByNode(element);
                    if (a == null)
                    {
                        a = _factory.CreateAdaptable(element);
                    }
                    if (a != null)
                    {
                        RegisterByNode(a, element);
                        RegisterById(a, id, document);
                    }
                }
            }
            return(a);
        }