#! /usr/bin/python

import xml.sax, xml.sax.handler
import string
from xml.dom.minidom import Document, parse, parseString


class wellFormedHandler(xml.sax.handler.ContentHandler):
	def __init__(self):
		self.result = []
		xml.sax.handler.ContentHandler.__init__(self)

	

if __name__ ==  "__main__":
	
	fileName = raw_input("File to test for well formedness:")
	fileHandler = file(fileName)
	wellFormedH = wellFormedHandler()
	xml.sax.parse(fileHandler, wellFormedH)
	
	print "YES !"
	print "The XML file is well formed!"
