+def find_file(root, name):
+ """
+ Returns the absolute path or None.
+ """
+ abs_path = None
+ for base, dirs, files in os.walk(root):
+ for tmp in files:
+ if tmp.endswith(name):
+ abs_path = os.path.abspath(os.path.join(base, tmp))
+ return abs_path
+
+
+def validate(xml_path, xsd_path):
+
+ xmlschema_doc = etree.parse(xsd_path)
+ xmlschema = etree.XMLSchema(xmlschema_doc)
+
+ xml_doc = etree.parse(xml_path)
+ result = xmlschema.validate(xml_doc)
+
+ return result
+