if(!XMLPath.startsWith("http")){
Identifier xmlId = APILocator.getIdentifierAPI().find(host, XMLPath);
if(xmlId!=null && InodeUtils.isSet(xmlId.getId()) && xmlId.getAssetType().equals("contentlet")){
Contentlet cont = APILocator.getContentletAPI().findContentletByIdentifier(xmlId.getId(), true, APILocator.getLanguageAPI().getDefaultLanguage().getId(), userAPI.getSystemUser(),false);
if(cont!=null && InodeUtils.isSet(cont.getInode())){
xmlSource = new StreamSource(new InputStreamReader(new FileInputStream(cont.getBinary(FileAssetAPI.BINARY_FIELD)), "UTF8"));
}
}else{
File xmlFile = fileAPI.getFileByURI(XMLPath, host, true,userAPI.getSystemUser(),false);
xmlSource = new StreamSource(new InputStreamReader(new FileInputStream(fileAPI.getAssetIOFile(xmlFile)), "UTF8"));
}
}else{
xmlSource = new StreamSource(XMLPath);
}
Source xsltSource = new StreamSource(new InputStreamReader(new FileInputStream(binFile), "UTF8"));
// create an instance of TransformerFactory
TransformerFactory transFact = TransformerFactory.newInstance();
StreamResult result = new StreamResult(new ByteArrayOutputStream());
Transformer trans = transFact.newTransformer(xsltSource);