'Parses XML string and returns object representation of relevant info.
Args:
xml_str: The XML string.
Returns:
An IndexDefinitions object containing the result of parsing the XML.
Raises:
ValidationError: In case of malformed XML or illegal inputs.'

def Parse(self, xml_str):

    try:
        self.indexes = []
        self.errors = []
        xml_root = ElementTree.fromstring(xml_str)
        if (xml_root.tag != 'datastore-indexes'):
            raise ValidationError('Root    tag    must    be    <datastore-indexes>')
        for child in xml_root.getchildren():
            self.ProcessIndexNode(child)
        if self.errors:
            raise ValidationError('\n'.join(self.errors))
        return IndexDefinitions(indexes=self.indexes)
    except ElementTree.ParseError as e:
        raise ValidationError(('Bad    input    --    not    valid    XML:    %s' % e))
