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.

def parse_gpx(gpx_element, gpxns=None):
    """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.
    """
    gpxns = gpxns if gpxns is not None else determine_gpx_namespace(gpx_element)

    if gpx_element.tag != gpxns+'gpx':
        raise ValueError("No gpx root element")

    version = gpx_element.attrib['version']

    if version == '1.0':
        return parse_gpx_1_0(gpx_element, gpxns=gpxns)
    elif version == '1.1':
        return parse_gpx_1_1(gpx_element, gpxns=gpxns)
    else:
        raise ValueError("Cannot parse GPX version {0}".format(version))