How to find all placemarks in a kml file

I am trying to find all the placemarks in a kml file, but the list is returning empty. What am I doing wrong?

def scan (filename):
    from lxml import etree
    tree = etree.parse(open(filename,encoding='utf-8'))
    root = tree.getroot()   
    namespaces = {'kml': 'http://www.opengis.net/kml/2.2'}
    placemarks = root.findall(".//{kml}Placemark", namespaces)
    for placemark in placemarks: 
        ##LIST IS EMPTY!!!
        name_text = placemark.findtext('.//name')
    return

------KML file
;<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
	<Document>
		<Style id="waypoint-pin">
			<IconStyle>
				<scale>1.3</scale>
				<Icon>
					<href>http://maps.google.com/mapfiles/kml/pushpin/blue-pushpin.png</href>
				</Icon>
				<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
			</IconStyle>
		</Style>
		<Placemark>
			<name><![CDATA[Gh x3 flowering and 10 more rhs 30m above bridge ]]></name>
			<description><![CDATA[Location: 55.891988, -3.096577<br/>
Elevation: 45 m<br/>
Time Created: 29/06/2022 13:56:42<br/>
]]></description>
			<TimeStamp>
				<when>2022-06-29T12:56:42Z</when>
			</TimeStamp>
			<styleUrl>#waypoint-pin</styleUrl>
			<Point>
				<coordinates>-3.096577,55.891988,45.1</coordinates>
			</Point>
		</Placemark>

Where exactly are you expecting doc to come from? What should its .findall do, according to your understanding; and what does the documentation say about how to use it?

What do you hope to accomplish with this part? In particular, do you see root being used later in the code?

My mistake - the doc should have been root. Now changed

The format of the findall is supposed to find all instances at whatever depth. In this file its inside a <document> layer, but other files we process there is a further <Folder>layer container