def read_gpx(xml, gpxns=None):
tree = etree.parse(xml)<EOL>gpx_element = tree.getroot()<EOL>return parse_gpx(gpx_element, gpxns)<EOL>
Parse a GPX file into a GpxModel.

    Args:
        xml: A file-like-object opened in binary mode - that is containing
             bytes rather than characters. The root element of the XML should
             be a <gpx> element containing a version attribute. GPX versions
             1.0 and 1.1 are supported.

        gpxns: The XML namespace for GPX in Clarke notation (i.e. delimited
             by curly braces). If None, (the default) the namespace used in
             the document will be determined automatically.

    Returns:
        A GpxModel representing the data from the supplies xml.

    Raises:
        ValueError: The supplied XML could not be parsed as GPX.