In the below code, $y returns one attribute value that looks like "OK HL DJ FJJ FJ" etc. $l returns attribute values that look like "OK" "HL". The idea, is that I want to see if $l is contained within $y, and if so to print it out. So really the third line of code past /country/ is where I am confused. I am not sure how to include a function past there to do what I described.
let $g := doc("cars.xml")/cars/honda[@id="hondaCivic"]
let $y := ($g/@type)
for $l in doc("cars.xml")/cars/country/[@car_code]????
return $y