I'm not quite sure what you're using the if and it's content for, can't make any sense of it, but at least this should be without your bugs, I guess you have copy pasted code from old code (witch probably used sequence operator, where it was more normal to use namespace, aka ":" aka $Nodes:item.something ).