XD-961: Fix XML serialization of streams