final TransformerFactory factory = TransformerFactory.newInstance();
final TransformerURIResolver resolver = new TransformerURIResolver();
factory.setURIResolver(resolver);
for (final Iterator xsltIterator = xslts.iterator(); xsltIterator.hasNext();)
{
final Transformation transformation = (Transformation)xsltIterator.next();
final URL xslt = new URL(transformation.getUri());
resolver.setLocation(xslt);
if (xslt != null)
{
AndroMDALogger.info("Applying transformation --> '" + xslt + "'");
final Source xsltSource = new StreamSource(xslt.openStream());
final javax.xml.transform.Transformer transformer = factory.newTransformer(xsltSource);
final ByteArrayOutputStream output = new ByteArrayOutputStream();
final Result result = new StreamResult(output);
transformer.transform(modelSource, result);
final byte[] outputResult = output.toByteArray();
stream = new ByteArrayInputStream(outputResult);
// if we have an output location specified, write the result
final String outputLocation = transformation.getOutputLocation();
if (StringUtils.isNotBlank(outputLocation))
{
final File fileOutput = new File(outputLocation);
final File parent = fileOutput.getParentFile();
if (parent != null)