title: How to 'transform' a String object (containing XML) to an element on an existing JSP page
body: <p>Currently, I have a String object that contains XML elements:</p>
  
  <pre><code>String carsInGarage = garage.getCars();
  </code></pre>
  
  <p>I now want to pass this String as an input/stream source (or some kind of source), but am unsure which one to choose and how to implement it.</p>
  
  <p>Most of the solutions I have looked at import the package: javax.xml.transform and accept a XML file (stylerXML.xml) and output to a HTML file (outputFile.html) (See code below).</p>
  
  <pre><code>try 
  {
      TransformerFactory tFactory = TransformerFactory.newInstance();
      Transformer transformer = tFactory.newTransformer(new StreamSource("styler.xsl"));
  
      transformer.transform(new StreamSource("stylerXML.xml"), new StreamResult(new FileOutputStream("outputFile.html")));
  }
  catch (Exception e)
  {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>I want to accept a String object and output (using XSL) to a  element within an existing JSP page. I just don't know how to implement this, even having looked at the code above.</p>
  
  <p>Can someone please advise/assist. I have searched high and low for a solution, but I just can't pull anything out.</p>