'Parses XML string and returns object representation of relevant info.
Uses ElementTree parser to return a tree representation of XML.
Then walks down that tree and extracts important info and adds it to the
object.
Args:
xml_str: The XML string itself.
has_jsps: True if the application has *.jsp files.
Returns:
If there is well-formed but illegal XML, returns a list of
errors. Otherwise, returns an AppEngineWebXml object containing
information from XML.
Raises:
AppEngineConfigException: In case of malformed XML or illegal inputs.'

def ProcessXml(self, xml_str, has_jsps=False):

    try:
        self.web_xml = WebXml()
        self.web_xml.has_jsps = has_jsps
        self.errors = []
        xml_root = ElementTree.fromstring(xml_str)
        for node in xml_root.getchildren():
            self.ProcessSecondLevelNode(node)
        if self.errors:
            raise AppEngineConfigException('\n'.join(self.errors))
        return self.web_xml
    except ElementTree.ParseError:
        raise AppEngineConfigException('Bad    input    --    not    valid    XML')
