def parse_gpx(gpx_element, gpxns=None):
gpxns = gpxns if gpxns is not None else determine_gpx_namespace(gpx_element)<EOL>if gpx_element.tag != gpxns+'<STR_LIT>':<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>version = gpx_element.attrib['<STR_LIT:version>']<EOL>if version == '<STR_LIT:1.0>':<EOL><INDENT>return parse_gpx_1_0(gpx_element, gpxns=gpxns)<EOL><DEDENT>elif version == '<STR_LIT>':<EOL><INDENT>return parse_gpx_1_1(gpx_element, gpxns=gpxns)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>".format(version))<EOL><DEDENT>
Parse a GPX file into a GpxModel.

    Args:
        gpx_element: The root <gpx> element of an XML document 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).

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

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