let rec contents t = flatten (map contents1 t) and contents1 n = match n with | Node (a,b, children) -> (a,b) :: (contents children)