title: How to POST with XML payload in node-red
body: <p>Just starting to work with node-red and having trouble getting XML loaded into a javascript object msg.payload that node-red needs for sending a post request to my server.</p>
  
  <p>My API is looking for the following:  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;userRequest&gt;
        &lt;authentication&gt;
            &lt;username&gt;foo&lt;/username&gt;
            &lt;password&gt;bar&lt;/password&gt;
        &lt;/authentication&gt;
        &lt;action&gt;doit&lt;/action&gt;
    &lt;/userRequest&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But without escaping the XML, I can't get it loaded into the object.  And I can't find the right way to escape it.</p>
  
  <p>Advice?</p>
  
  <p>So far I've tried to escape the XML in various ways to get it past the JS parser in node-red, but nothing seems to work.  Node-red always complains that there is an error in the code.  </p>
  
  <p>There are examples of it outputting XML, but nothing about how to send XML payloads on a POST to an external serve. </p>