Port from $.ajax to javascript XMLHttpRequest?
===

Looking for some help to convert the following from jquery ajax to javascript using XMLHttpRequest?

    $.ajax({
        url: 'api/dev/blah?id=4F',        
        type: 'GET',
        beforeSend: function(req) {
            req.setRequestHeader("Accept", "application/xml");
        },
        success: function (result) {
            alert('success');
            // Parse xml here...
        },
        error: function() { 
            alert('error');
    }
    });

I've tried something similar to this but to no avail (not xmlhttprequest savvy):

    function junk() {
      var request = new XMLHttpRequest();
       request.addEventListener('load', successCallback, false);
    
       request.open("GET", 'api/dev/blah?id=4F', true);
       request.setRequestHeader("Accept","application/xml");
       request.setRequestHeader("Content-Type", "application/xml");
       request.send();
    }
    
    function successCallback(data) {
      alert('success');
    }