Is there any way to check if a string entered is XML or not?
function fetchData () {
    if (xmlString.value !== "") {   
        parser = new DOMParser;
        xmlDoc = parser.parseFromString(xmlString.value, 'text/xml');
    } else {
        outputHtml.value = "Please type your XML properly";
    }
}
Now I can only check if input is empty.