src/openSourceC.DotNetLibrary.Core/XmlSerialize.cs
/// <summary>
///		Serializes the specified object and writes the XML fragment to the specified
///		<see cref="TextWriter"/>.
/// </summary>
/// <param name="type">The type of the object to serialize.</param>
/// <param name="obj">The <see cref="object"/> to serialize.</param>
/// <param name="output">The <see cref="TextWriter"/> of which to write the XML document.</param>
/// <param name="supportXsiNamespace"><b>true</b> to support xsi namespace (i.e. xsi:type,
///		xsi:nil, xsi:schema, xsi:schemaLocation, and xsi:noNamespaceSchemaLocation).</param>
/// <param name="expandForReadability"><b>true</b> to expand the XML with line feeds and
///		spacing, <b>false</b> to remove all readability formatting.</param>
Serializes the specified object and writes the XML fragment to the specified
.
Serializes the specified object and writes the XML fragment to the specified .
public static void Serialize(Type type, object obj, TextWriter output, bool supportXsiNamespace = false, bool expandForReadability = false)
		{
			if (type == null)
			{
				throw new ArgumentNullException(nameof(type));
			}
			using (XmlWriter xmlWriter = XmlWriter.Create(output, GetNewXmlWriterSettingsObject(expandForReadability)))
			{
				Serialize(type, obj, xmlWriter, supportXsiNamespace);
				xmlWriter.Flush();
			}
		}
public static void Serialize ( Type type , object obj , TextWriter output , bool supportXsiNamespace = false , bool expandForReadability = false ) { if ( type == null ) { throw new ArgumentNullException ( nameof ( type ) ) ; } using ( XmlWriter xmlWriter = XmlWriter . Create ( output , GetNewXmlWriterSettingsObject ( expandForReadability ) ) ) { Serialize ( type , obj , xmlWriter , supportXsiNamespace ) ; xmlWriter . Flush ( ) ; } }
Serializes the specified object and writes the XML fragment to the specified
.
Serializes the specified object and writes the XML fragment to the specified .
type
Type
The type of the object to serialize.
The type of the object to serialize .
obj
object
The  to serialize.
The to serialize .
output
TextWriter
The  of which to write the XML document.
The of which to write the XML document .
supportXsiNamespace
bool
None
expandForReadability
bool
None