title: Comparing efficiency: XSLT Vs XML-Parsing to transform from XML to XML
body: <p>I've read in a technical paper that using XSLT for making amendments in an XML file is a more efficient and preferable way than using the XML Parser like DOM, JDOM, SAX, JSoup etc.  So I wanted to know on which parameters XSLT is more efficient and preferable to use than XML parser. (Does XSLT provide more generalized and easier solution?)
  Thanking you.</p>
  
  <p>E.g.:
  If I've one XML file:</p>
  
  <pre><code>&lt;node1&gt;
  &lt;node2&gt; TEXT &lt;/node2&gt;
  &lt;/node1&gt;
  </code></pre>
  
  <p>and I need the output as:</p>
  
  <pre><code>&lt;node1&gt;
  &lt;node2&gt; TEXT &lt;/node2&gt;
  &lt;script src="xyz.js"&gt;&lt;/srcipt&gt;
  &lt;/node&gt;
  </code></pre>
  
  <p>Then either I can write an XSLT for this to get the desired output or I can use XML-parser (DOM, SAX etc.) to write a Java program to insert the required element at the desired place and get the desired output. So for this I have read that XSLT is considered more preferable and effective.</p>