How to get the iteration id from the pub.schema.validate service?

I have a flat file that after converting it to XML, I can use pub.schema.validate service to validate it against my xsd schema, it works fine if I just want to know the report of the errors, but my use case requires me to get the iteration id of the invalid element from the current xml collection so that I can proceed to process those valid records and send notification for those invalid records. Is there a way that can achieve this goal?

I have a solution to this problem now - to create a XML node for each entry and use the pub.schema.validate to validate against the xsd.