title: jQuery converting XML tags to uppercase
body: <p>I have a AJAX requests which returns a string of XML which I'd like to inject into the DOM. My function looks like </p>
  
  <pre><code>  $.ajax({
      type: 'POST',
      url: "myrequest",
      data: postdata,
      datatype: 'json',
      success: function (arguments) {
          newxmlstring = arguments.newxml;
          oldnode = $("someselector specified in the arguments passed");
          oldnode.replaceWith(newxmlstring);
      }
    });
  </code></pre>
  
  <p>This works but it appears that the replaceWith function maps all <code>nodeName</code> into capitalized versions of the response sent by the server. I'm assuming this is some quirk with trying to use jQuery to handle XML? </p>
  
  <p>So for example if the response string is <code>&lt;data&gt;asdf&lt;/data&gt;</code> when I access <code>$(newnode)[0].nodeName</code> I get <code>'DATA'</code>.</p>
  
  <p>Does anybody know how to handle the new XML while preserving the <code>nodeName</code> in lower case?</p>
  
  <p>EDIT: My response is JSON since it contains the new xml string and a bit of other data about where to attach the new xml node. So I'd prefer to keep <code>datatype: 'json'</code> if at all possible. </p>