<PackageReference Include="NLog" Version="6.2.2" />

NLog.Layouts.XmlLayout

public class XmlLayout : XmlElementBase
A specialized layout that renders XML-formatted events.
public bool ElementEncode { get; set; }

Determines whether or not this attribute will be Xml encoded.

public string ElementName { get; set; }

Name of the root XML element

public Layout ElementValue { get; set; }

Value inside the root XML element

public XmlLayout()

Initializes a new instance of the XmlLayout class.

public XmlLayout(string elementName, Layout elementValue)

Initializes a new instance of the XmlLayout class.