// <auto-generated/>

#nullable disable

using System.ClientModel.Primitives;
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;

            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);
        }
    }
}
