BUG-869: replaced inefficient use of keySet with entrySet in XmlUtils