let of_stream ?(escape_cdata=false) ?(escape_nott=false) stream = let next _ = try Some (of_block ~escape_cdata ~escape_nott (Stream.next stream)) with Stream.Failure -> None in Stream.from next