The XmlSerializer class in .NET adds those namespaces by default (e.g xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”) because they are commonly used in XML schemas. However, you can remove them by creating an XmlSerializerNamespaces object and passing it to the Serialize method. Here’s how you can do it:

// Create an instance of your class
var salesInvoices = new SALES_INVOICES
{
    INVOICE = new List<INVOICE>
    {
        new INVOICE
        {
            INTERNAL_REFERENCE = "123",
            TYPE = "type1",
            // Set other properties...
        },
        // Add more INVOICE instances if needed...
    }
};

// Create an XmlSerializer
var serializer = new XmlSerializer(typeof(SALES_INVOICES));

// Create an XmlSerializerNamespaces and add an empty namespace
var namespaces = new XmlSerializerNamespaces();
namespaces.Add("", "");

// Serialize the object to a string
var sb = new StringBuilder();
using (var writer = new StringWriter(sb))
{
    serializer.Serialize(writer, salesInvoices, namespaces);
}

// Get the serialized string
string xml = sb.ToString();

// Now you can do whatever you want with the XML string
Console.WriteLine(xml);

In this code, namespaces.Add("", ""); adds an empty namespace, which effectively removes the default namespaces.