src/openSourceC.DotNetLibrary.Core/XmlSerialize.cs
/// <summary>
///		Serializes the specified object and returns the XML fragment as an <see cref="T:XElement"/>.
/// </summary>
/// <typeparam name="TObject">The type of the object to serialize.</typeparam>
/// <param name="obj">The <see cref="object"/> to serialize.</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>
/// <returns>
///		An <see cref="T:XElement"/> representation of the object.
/// </returns>
Serializes the specified object and returns the XML fragment as an .
Serializes the specified object and returns the XML fragment as an .
public static XElement SerializeToXElement<TObject>(TObject obj, bool supportXsiNamespace = false, bool expandForReadability = false)
			where TObject : notnull
		{
			return SerializeToXElement(typeof(TObject), obj, supportXsiNamespace, expandForReadability);
		}
public static XElement SerializeToXElement < TObject > ( TObject obj , bool supportXsiNamespace = false , bool expandForReadability = false ) where TObject : notnull { return SerializeToXElement ( typeof ( TObject ) , obj , supportXsiNamespace , expandForReadability ) ; }
Serializes the specified object and returns the XML fragment as an .
Serializes the specified object and returns the XML fragment as an .
An  representation of the object.
An representation of the object .
obj
TObject
The  to serialize.
The to serialize .
supportXsiNamespace
bool
None
expandForReadability
bool
None
typeparam
The type of the object to serialize.
The type of the object to serialize .