You can simply return (T)xmlDeserializer.Deserialize(reader);