A service discovery stream is represented as an N-ary tree that provides
the capability to change, add, or remove an element with only one
modification to the entire tree. The number of elements in a stream are
counted and each element and the element's children are converted into a
node of the N-ary tree. Each node in the tree can have any number of
siblings, which are linked to each other using a doubly linked list.