The XML serializer does not distinguish an empty NodeList property from a null NodeList property. In consequence "new HashSet()" and "new HashSet<>()" produce the same output: in one case type.typeArguments is null, in the other case it is empty.