Fix check for generic/unknown component in XML serialization

Thanks to David Binderman for finding this!