In your tex file, try this: \startluacode settings = {} docstruktur = {} doclistfile = "doclist.xml" local striplines = utilities.strings.striplines local xmltext = xml.text cropstring = function(s) -- return striplines(s, "prune and collapse") return striplines(s) end doc = xml.load(doclistfile, settings) for v in xml.collected(doc,"/doclist/psdoc/") do -- print (v) -- print (xml.text(v,"/docnr")) local docnr = cropstring(xml.text(v,"/docnr")) print (docnr) local docname = cropstring(xmltext(v,"/docname")) -- es kann mehrere DOCAN geben! local docan = (cropstring(xmltext(v,"/docan"))) local docverantwortlich = (cropstring(xmltext(v,"/docverantwortlich"))) docstruktur[docnr]={ docname = docname, docan = docan, docverantwortlich = docverantwortlich } -- docstruktur[docnr]["docname"] = docname -- docstruktur[docnr]["docan"] = docan -- docstruktur[docnr]["docverantwortlich"] = docverantwortlich end \stopluacode hoping it helps, Massi