Is there a way to get all values for specific field name in xml file? This field appears multiple times in different nested levels, and I don't know in advance where it may be in document.
Use a Decoder
from encoding/xml
and iterate over your XML with func (*Decoder) Token
. While iterating check for StartElement
s with the desired Name
.