Here is how I accomplished the task. It's quick and dirty, but it shows the process. It parses properly and uses the NP++ Block comment/uncomment style
Python:
dummyCoordinates = [(0,0),(1000,0),(1000,10000),(0,10000),]
comment1 = ET.Comment("<CutoutSubdesign>")
xmlTag.insert(1, comment1)
comment2 = ET.Comment("\t<Polygon>")
xmlTag.insert(2, comment2)
idxCount = 3
for X,Y in dummyCoordinates:
comment = ET.Comment("\t\t<Point x=\"{:.3f}um\" y=\"{:.3f}um\"/>".format(X,Y))
xmlTag.insert(idxCount, comment)
idxCount += 1
comment3 = ET.Comment("\t</Polygon>")
xmlTag.insert(idxCount, comment3)
comment4 = ET.Comment("</CutoutSubdesign>")
xmlTag.insert(idxCount + 1, comment4)
Result:
<!--<CutoutSubdesign>-->
<!-- <Polygon>-->
<!-- <Point x="0.000um" y="0.000um"/>-->
<!-- <Point x="1000.000um" y="0.000um"/>-->
<!-- <Point x="1000.000um" y="10000.000um"/>-->
<!-- <Point x="0.000um" y="10000.000um"/>-->
<!-- </Polygon>-->
<!--</CutoutSubdesign>-->