Need to display xml file in html div by using external JavaScript?

Can you clarify "external"? Is the xml file local? Here is something based on what I can infer...

    var http={
        init:   function()              { try {return new XMLHttpRequest();} catch (error) {} try {return new ActiveXObject("Msxml2.XMLHTTP");} catch (error) {} try {return new ActiveXObject("Microsoft.XMLHTTP");} catch (error) {} throw new Error("Could not create HTTP request object."); },
        get:    function(url)           { var h=this.init();"GET", url, false); h.withCredentials=true; h.send(null); return h.responseText; },
    function load() {
        var xml=http.get('');
<input type=button onclick="load();" value="Load >" />
<div id=div1></div>