Try this:
public void XslTransform(string xsltFileLocation, string xmlDocumentLocation, string DestinationFilepathName)
{
using (MemoryStream ms = new MemoryStream())
{
Stream fs = File.OpenRead(xsltFileLocation);
XPathDocument myXPathDoc = new XPathDocument(xmlDocumentLocation);
XmlTextReader xtr = new XmlTextReader(fs);
XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load(xtr);
myXslTrans.Transform(myXPathDoc, null, ms);
ms.Flush();
ms.Position = 0;
FileStream fsNew = new FileStream(DestinationFilepathName, FileMode.Create, FileAccess.Write);
byte[] bytes = new byte[ms.Length];
ms.Read(bytes, 0, (int)ms.Length);
fsNew.Write(bytes, 0, bytes.Length);
fsNew.Close();
ms.Close();
}
}