ExtractFileNameOnly(...) accepts a STRING only, not a Stringlist.
You need to index it to get the entry you want.
so it looks like you are in a loop and you need a counter as you add nodes. That counter is also used to index the stringList ..
ExtractFileNameOnly(SL[?]);