How can I make the xmlserializer only serialize plain xml?

To put this all together – this works perfectly for me: // To Clean XML public string SerializeToString<T>(T value) { var emptyNamespaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty }); var serializer = new XmlSerializer(value.GetType()); var settings = new XmlWriterSettings(); settings.Indent = true; settings.OmitXmlDeclaration = true; using (var stream = new StringWriter()) using (var writer = XmlWriter.Create(stream, … Read more

Meaning of –

To understand the “encoding” attribute, you have to understand the difference between bytes and characters. Think of bytes as numbers between 0 and 255, whereas characters are things like “a”, “1” and “Ä”. The set of all characters that are available is called a character set. Each character has a sequence of one or more … Read more