title: Get SVG XML from .svg file via URL using Nodejs
body: <p>I am trying to get the XML data string from an SVG that is externally hosted. I should note I am using Nodejs. My goal is to embed the contents of my .svg file into a string like below:</p>
  <pre><code>&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
      &lt;g transform=&quot;translate(${x}, ${y}) scale(${scale})&quot;&gt;
          //INLINE SVG
      &lt;/g&gt;
  &lt;/svg&gt;`
  </code></pre>
  <p>The reason for this approach is so that the svg is inline instead of referenced via a URL. I want to embed the contents of the svg file dynamicallly. The file changes based on an API request so I cannot just open the svg file and copy and paste the contents. It needs to be parsed programmatically so that whatever .svg file is provided via a URL gets turned into inline svg.</p>
  <p>What is the best approach to achieve my goal?</p>