--- /dev/null
+<stations>
+{
+for $doc in ('stations.qpl')
+for $station in doc($doc)//station,
+ $stationcode in doc('stationcodes.qpl')//station[name = $station/name]
+return
+<station>
+{$station/name}
+{$station/pos}
+{$stationcode/code}
+</station>
+}
+{
+for $doc in ('stations.qpl')
+for $station in doc($doc)//station
+let $stationcode := doc('stationcodes.qpl')//station[name != $station/name]
+where
+$station/name != $stationcode/name
+return
+<station>
+{$station/name}
+{$station/pos}
+</station>
+}
+</stations>
--- /dev/null
+<stations>
+ <station>
+ <name>Genova Piazza Principe sotterranea</name>
+ <code>S04701</code>
+ </station>
+ <station>
+ <name>Genova San Biagio</name>
+ <code>S04222</code>
+ </station>
+ <station>
+ <name>Genova Voltri</name>
+ <code>S04534</code>
+ </station>
+ <station>
+ <name>Torino Porta Nuova</name>
+ <code>S00219</code>
+ </station>
+</stations>
+