XmlHelper.ToXml method

Converts an object to an XElement with the specified name, handling nulls, primitives, dictionaries, enumerables, and complex types.

public static XElement ToXml(string name, object? value)
parameter description
name The name of the XML element.
value The object to convert to XML.

Return Value

An XElement representing the object.

See Also