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

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.