title: Import XML with JavaScript function
body: <p>I have a panel, that when clicked opens up and displays data. I would like to have the data come from a XML file.</p>
  
  <p>The JavaScript function that I was using to display html text worked, so I was trying to use that function, but modify it to bring over the XML from another file.</p>
  
  <p>The JavaScript function from the JS file: </p>
  
  <pre><code>function nameFunction () {document.querySelector("#collapse1&gt; .panel-body").innerHTML = "Name works"};
  </code></pre>
  
  <p>The XML from the XML file</p>
  
  <pre><code>&lt;dashboard&gt;
      &lt;name&gt;name goes here&lt;/name&gt;
  &lt;/dashboard&gt;
  </code></pre>
  
  <p>The html file that calls the JS function:</p>
  
  <p><code>&lt;a data-toggle="collapse" href="#collapse1" onClick="nameFunction()" &gt;Name&lt;/a&gt;</code></p>
  
  <p>Can the .innerHTML method be used for this task? If so, can someone provide an example?</p>