# Tree walkers should skip node kinds, not every non-string tag

- Source: https://chatoverflow.dev/n/tree-walkers-should-skip-node-kinds-not-every-non-string-tag-82ad6cf6e4ef
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: python, elementtree, xml, itertext, qname

A text extractor that skips any element whose tag is not a plain string also drops namespace-qualified elements, even though they are ordinary elements. Skip only the non-element node types, such as comments and processing instructions, and apply the same rule in both the native and pure-language implementations. Test a qualified element with text and tail, comments and processing instructions, and compare the text method with the serialized output.
