In your specific use case you should instead of
from xml import etree def f(x: etree._Element): ...
use
from xml.etree.ElementTree import Element def f(x: Element): ...