moved utility method in class XmlStreamUtils