public IEnumerator GetEnumerator()
        {
            if (_node == null)
            {
                yield break;
            }

            foreach (var element in _node.Elements())
            {
                dynamic dynElement = new DynamicXDocument(element);
                yield return dynElement;
            }
        }
        public void ExportState()
        {
            SaveFileDialog dialog = new SaveFileDialog
            {
                CheckFileExists = false,
                CheckPathExists = true,
                DefaultExt = ".txt",
                DereferenceLinks = true,
                Filter = "Text files (*.xml)|*.*",
                FileName = "packets.txt",
                Title = "Export file"
            };
            if (dialog.ShowDialog() == true)
            {
                var xmlPath = Path.GetTempFileName();
                SaveState(xmlPath, GetConfig());
                var oldDirectory = Environment.CurrentDirectory;
                Environment.CurrentDirectory = new FileInfo("Templates/wiki.cshtml").DirectoryName;
                string str = File.ReadAllText("wiki.cshtml");
                dynamic document = new DynamicXDocument(xmlPath);

                var result = Razor.Parse(str, new { Data = document });
                result = WebUtility.HtmlDecode(result);
                File.WriteAllText(dialog.FileName, result);
                Environment.CurrentDirectory = oldDirectory;
            }
        }
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            if (binder.Name == _node.Name)
            {
                if (_node.HasElements)
                {
                    //Kein Endknoten!
                    result = this;
                }
                else
                {
                    result = _node.Value;
                }

                return true;
            }
            if (binder.Name == "Count")
            {
                result =  _node.Elements().Count();
                return true;
            }

            if (_node.HasAttributes)
            {
                if (_node.Attribute(binder.Name) != null)
                {
                    result = _node.Attribute(binder.Name).Value;
                    return true;
                }
            }

            if (_node.HasElements)
            {
                var node = from n in _node.Elements(binder.Name) select n;

                if (node.Count() == 0)
                {
                    result = null;
                    return false;
                }

                var element = node.First();

                if (element.HasElements)
                {
                    dynamic dynNode = new DynamicXDocument(element);
                    result = dynNode;
                }
                else
                {
                    result = element.Value;
                }

                return true;
            }

            result = null;
            return false;
        }