def from_file(cls, xml_path):
    """Parse .xml file and create a XmlParser object."""
    try:
      parsed_xml = cls._parse(xml_path)
    except OSError as e:
      raise XmlParser.XmlError("Problem reading xml file at {}: {}".format(xml_path, e))
    return cls(xml_path, parsed_xml)
Parse .xml file and create a XmlParser object.