Or maybe we're not thinking big enough here. Maybe we're looking at a generalized tree query language that, as limiting cases, defines the .splits and .allsplits as (re)linearized query results, where .splits linearizes the top level nodes, and .allsplits linearizes the leaves, but may intermediate linearizations are possible. Don't want to get stuck into binary thinking here...
Larry