// <auto-generated/>

#nullable disable

using System;
using System.ClientModel.Primitives;
using System.Collections.Generic;
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.Xml.Linq.XNamespace categoryNs = "https://example.com/ns1";

            string id = default;
            string category = default;
            global::System.Collections.Generic.IDictionary<string, global::System.BinaryData> additionalBinaryDataProperties = new global::Sample.ChangeTrackingDictionary<string, global::System.BinaryData>();

            foreach (var child in element.Elements())
            {
                string localName = child.Name.LocalName;
                global::System.Xml.Linq.XNamespace ns = child.Name.Namespace;

                if ((localName == "id"))
                {
                    id = ((string)child);
                    continue;
                }
                if (((localName == "category") && (ns == categoryNs)))
                {
                    category = ((string)child);
                    continue;
                }
            }
            return new global::Sample.Models.TestXmlModel(id, category, additionalBinaryDataProperties);
        }
    }
}
