using System.Xml;

namespace ZionVault.Encoders.Xml
{
    public class Element
    {
        private string name;
        private string value;

        public string Name { get => name; set => name = value; }
        public string Value { get => value; set => this.value = value; }

        public Element(string name, string value)
        {
            this.name = name;
            this.value = value;
        }

        public void AppendTo(XmlDocument doc, XmlNode parent)
        {
            XmlElement element = doc.CreateElement(name);
            element.InnerText = value;

            parent.AppendChild(element);
        }
    }
}
