function getOrderedChildren(node) {
  var queue = [];
  for (var key in node) {
    if (node.hasOwnProperty(key)) {
      enqueueNodeWithStartIndex(queue, node[key]);
    }
  }
  queue.sort(function(a, b) { return a[1] - b[1]; });
  return queue.map(function(pair) { return pair[0]; });
}
It is crucial that we traverse in order, or else catchup() on a later
node that is processed out of order can move the buffer past a node
that we haven't handled yet, preventing us from modifying that node.

This can happen when a node has multiple properties containing children.
For example, XJSElement nodes have `openingElement`, `closingElement` and
`children`. If we traverse `openingElement`, then `closingElement`, then
when we get to `children`, the buffer has already caught up to the end of
the closing element, after the children.

This is basically a Schwartzian transform. Collects an array of children,
each one represented as [child, startIndex]; sorts the array by start
index; then traverses the children in that order.