considering that `return $visitor->getResult();` is the last line in `serialize` method, could set a boolean flag in `visitNull`, and add the namespace in `getResult` method if the `visitNull` was called.

does this seem better?