title: Line Break in XML?
body: <p>I'm a beginner in web development, and I'm trying to insert line breaks in my XML file.
  This is what my XML looks like:</p>
  
  <pre><code>&lt;musicpage&gt;
     &lt;song&gt;
        &lt;title&gt;Song Title&lt;/title&gt;
        &lt;lyric&gt;Lyrics&lt;/lyric&gt;
     &lt;/song&gt;
  
      &lt;song&gt;
        &lt;title&gt;Song Title&lt;/title&gt;
        &lt;lyric&gt;Lyrics&lt;/lyric&gt;
     &lt;/song&gt;
  
      &lt;song&gt;
        &lt;title&gt;Song Title&lt;/title&gt;
        &lt;lyric&gt;Lyrics&lt;/lyric&gt;
     &lt;/song&gt;
  
      &lt;song&gt;
        &lt;title&gt;Song Title&lt;/title&gt;
        &lt;lyric&gt;Lyrics&lt;/lyric&gt;
     &lt;/song&gt;
  &lt;/musicpage&gt;
  </code></pre>
  
  <p>I want to have line breaks in between the sentences for the lyrics. I tried everything from /n, &#xD; and other codes similar to it, PHP parsing, etc., and nothing works! Have been googling online for hours and can't seem to find the answer. I'm using the XML to insert data to an HTML page using Javascript.</p>
  
  <p>Does anyone know how to solve this problem?</p>
  
  <p>And this is the JS code I used to insert the XML data to the HTML page:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      if (window.XMLHttpRequest) {
      xhttp=new XMLHttpRequest();
  } else {
      xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xhttp.open("GET","xml/musicpage_lyrics.xml",false);
  xhttp.send("");
  xmlDoc=xhttp.responseXML;
  
  var x=xmlDoc.getElementsByTagName("songs");
  for (i=0;i&lt;x.length;i++) {
      document.write("&lt;p class='msg_head'&gt;");
      document.write(x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue);
      document.write("&lt;/p&gt;&lt;p class='msg_body'&gt;");
      document.write(x[i].getElementsByTagName("lyric")[0].childNodes[0].nodeValue);
      document.write("&lt;/p&gt;");
  }
  &lt;/script&gt;
  </code></pre>