con t ctx = source bool * xml ctx [] [] fun create [ctx] (x : xml ctx [] []) = s <- source False; return (s, x) fun expand [ctx] (t : t ctx) = set t.1 True fun collapse [ctx] (t : t ctx) = set t.1 False fun render [ctx] [[Body] ~ ctx] (t : t ([Body] ++ ctx)) =