final URL modelUrl = new URL(modelUri);
if (xsltTransformations != null && xsltTransformations.length > 0)
{
Source modelSource = new StreamSource(modelUrl.openStream());
final List xslts = Arrays.asList(xsltTransformations);
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);