Cross Domain XML POST
<p>I want to post cross domain XML with jQuery. Currently I receive the following error:</p>

<p>XMLHttpRequest cannot load XXX. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'XXX' is therefore not allowed access. The response had HTTP status code 401.</p>

<p>I've did some research and I've see different answers. Some are saying posting XML cross domain is not possible and some say that the external source needs to activate cross domain requests. What is the actual answer? </p>

<pre><code>var postXML = function(data) {
    if (data.length !== 0) {
        $.ajax({
            url: "XXX",
            data: data,
            contentType: "text/xml",
            dataType: "xml",
            crossDomain: true,
            headers: {
                "Authorization": "Basic XXX",
                "Accept": "application/json",
                "Content-Type": "text/plain"
            }
        }).done(function(output) {
            console.log(output);
        }).fail(function(error) {
            console.log(error);
        });
    }
};
</code></pre>