/**
 * Returns xml document object by xml string
 * @param messagesCountXml
 */
function getXmlDocument(xmlString) {
    var xmlDoc = null;
    // code for IE
    if (window.ActiveXObject) {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        //xmlDoc.async = false;
        xmlDoc.loadXML(xmlString);
        return xmlDoc;
    }
    // code for Mozilla, Firefox, Opera, etc.
    else if (document.implementation && document.implementation.createDocument) {
        xmlDoc = document.implementation.createDocument("", "", null);
        var domParser = new DOMParser();
        xmlDoc = domParser.parseFromString(xmlString, "text/xml");
        return xmlDoc;
    } else {
        alert('Your browser cannot handle this script');
        return null;
    }

}