refactored element type extraction line to separate function
refactored tests to exclude deserializing XmlKeyValuePairs