<PackageReference Include="NUnit" Version="4.5.1" />

NUnit.Framework.Interfaces.IXmlNodeBuilder

public interface IXmlNodeBuilder
An object implementing IXmlNodeBuilder is able to build an XML representation of itself and any children.
TNode AddToXml(TNode parentNode, bool recursive)

Returns a TNode representing the current object after adding it as a child of the supplied parent node.

TNode ToXml(bool recursive)

Returns a TNode representing the current object.