public interface ISerializer
{
/// <summary>
/// Serializes the specified root nodes and all of their descendants to a stream.
/// </summary>
/// <param name="roots">The nodes to serialize.</param>
/// <returns>The stream.</returns>
/// <remarks>Does not serialize reference targets that are not descendants of one of the provided root nodes.</remarks>
public Stream SerializeToStream(IEnumerable<INode> roots);
}
public interface IDeserializer
{
/// <summary>
/// Deserializes the specified stream to a collection of root nodes.
/// </summary>
/// <param name="stream">The Stream to deserialize.</param>
/// <returns>The deserialized nodes.</returns>
/// <remarks>Does not deserialize referenced nodes and the references to them if the referenced target node is not part of the <paramref name="stream"/>.</remarks>
public IEnumerable<INode> Deserialize(Stream stream);
}