public void SerializeToElement(MailMergeAddressCollection objectToSerialize, XElement elemToFill)
        {
            var serializer = SerializationFactory.GetStandardSerializer(typeof(MailMergeAddress));

            foreach (var addr in objectToSerialize)
            {
                elemToFill.Add(serializer.SerializeToXDocument(addr).FirstNode);
            }
        }
        public MailMergeAddressCollection DeserializeFromElement(XElement element)
        {
            var addrColl   = new MailMergeAddressCollection();
            var serializer = SerializationFactory.GetStandardSerializer(typeof(MailMergeAddressCollection));
            var result     = serializer.Deserialize(element) as List <object>;

            if (result == null)
            {
                return(addrColl);
            }
            foreach (MailMergeAddress addr in result)
            {
                addrColl.AddWithCurrentCharacterEncoding(addr);
            }
            return(addrColl);
        }