clr.AddReference("I2Common")
clr.AddReference("TWC.I2Libs")
clr.AddReference("System")

from System.IO import DirectoryInfo
from System.IO import Path

from TWC.I2.Util import Config

def Run(doc):

	root = doc.CreateElement("InvalidStarBundles")
	files = DirectoryInfo(Config.StarBundleInvalidBundles).GetFiles("*.zip")

	for x in range(0, len(files)):
		f = files[x]
		starBundle = doc.CreateElement("StarBundle")
		starBundleName = doc.CreateTextNode(f.Name)
		starBundle.AppendChild(starBundleName)
		root.AppendChild(starBundle)		
	
	doc.DocumentElement.AppendChild(root)