the node to serialize, with its descendants
the component serializers to apply
node-type mapping and subclass-state writer for application classes, and the unknown-component policy
the canonical, frozen document
FourError INVALID_APPLICATION_STATE for a node class with no type
name, or a component with no registered serializer (unless
SerializeSceneOptions.unknownComponents is "skip")
Serializes the subtree rooted at
rootinto a canonical §79 document.The document holds one root node, whose
typerecords whether it was aSceneor aGroupso the reader rebuilds the same class. Traversal is depth-first in insertion order (§6), and components appear in the registry's registration order, so serializing one scene twice yields identical text (§33).