// <auto-generated/>

#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.IO;
using System.Xml.Linq;
using Sample.Models;

namespace Sample
{
    public partial class TestXmlModel
    {
        internal static global::Sample.Models.TestXmlModel DeserializeTestXmlModel(global::System.Xml.Linq.XElement element, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
        {
            if ((element == null))
            {
                return null;
            }

            global::System.ClientModel.FileBinaryContent profileImage = default;

            foreach (var child in element.Elements())
            {
                string localName = child.Name.LocalName;
                if ((localName == "profileImage"))
                {
                    profileImage = new global::System.ClientModel.FileBinaryContent(new global::System.IO.MemoryStream(global::System.Convert.FromBase64String(child.Value), false));
                    continue;
                }
            }
            return new global::Sample.Models.TestXmlModel(profileImage);
        }
    }
}
