I am trying to import xml in to an InDesign Doc and save as pdf. I can get it work partially, but it keeps getting stuck about half way down on the import xml portion.

Can someone see what I need to fix??? I am new at this....

//Global Variables
var myTemplate = File("/Applications/Adobe InDesign CS6/Template/BannerSheet.indd"),
myFolder = Folder("/Applications/Adobe InDesign CS6/XML"),
myXMLDocs = myFolder.getFiles("*.xml");

//To automate the banner sheet to import skinny xml

//Iterate through the xml files
for (var i = 0; i < myXMLDocs.length; i++) {
//open template
var newDoc = app.open(myTemplate),
myXMLDocs = app.activeDocument;

//import xml


//Export PDF from InDesign

myPDFExportPreset = app.pdfExportPresets.item("Smallest File Size"),
app.activeDocument.exportFile(ExportFormat.pdfType, File("/Applications/Adobe InDesign CS6/XML/Outputs/myTestDocument.pdf"),
false, myPDFExportPreset);

//Save Function


function saveFiles() {
var newFileName = myFolder.absoluteURI + "/Applications/Adobe InDesign CS6/XML/Outputs" + myXMLDocs[i].name().replace (/xml/, /indd/);
newDoc.save(new File(newFileName));