Use datastream object to check mime type before processing XML.