var sOutput = validateFile("jboss.xml");

WScript.Echo(sOutput);

function validateFile(strFile)
{
    // Create an XML DOMDocument object.
    var x = new ActiveXObject("MSXML2.DOMDocument.4.0");

    //Load and validate the specified file into the DOM.
    x.async = false;
    x.validateOnParse = true;
    x.resolveExternals = true;
    x.load(strFile);

    // Return validation results in message to the user.
    if (x.parseError.errorCode != 0)
    {
        return("Errore di validazione file: " + strFile + 
               "\n=====================" +
               "\nMotivo: " + x.parseError.reason + 
               "\nSorgente: " + x.parseError.srcText + 
               "\nLinea: " + x.parseError.line + "\n");
    }
    else 
        return("Validazione effettuata con successo: " +  strFile +
               "\n===================================\n" 
               );
}