  'Change these variables to be the files to process
  XMLSource  = "c:\xml-to-edi-850\PO.xml"
  Stylesheet = "c:\xml-to-edi-850\POto850.xsl"
  TextDest   = "c:\xml-to-edi-850\850.txt"
  LTMFile    = "c:\\xml-to-edi-850\850.ltm"
  
  'Create the XML doc and transform it
  Set domSource = CreateObject("MSXML2.DOMDocument.3.0")
  domSource.Async = False
  domSource.Load XMLSource
  
  Set domXSL = CreateObject("MSXML2.DOMDocument.3.0")
  domXSL.Async = False
  domXSL.Load Stylesheet
  newSource = domSource.transformNode(domXSL)

  'Create the LTE engine and process it
  Set objLTE = CreateObject("LTE.Translator")
  objLTE.MapFile = LTMFile
  objLTE.Source = newSource
  objLTE.Direction = ToText
  newOutput = objLTE.Translate
  
  'Save the final output
  Set objFile = CreateObject("Scripting.FileSystemObject")
  Set lsPersistStream = objFile.OpenTextFile(TextDest, 2, True)
  lsPersistStream.Write newOutput
  lsPersistStream.Close
  
  MsgBox "Translation Complete."

