Importing Purchase Invoices with XMLPORT

I have a XMLPORT with a Line Tag

The firt time my XML is executed, the Variable X on Line Tag is Equal to 3.

How can I Skip The Line Tag if Variable X is Equal to 3.

My Line Tag is related to Purchase Invoice Line.

In Purchase Invoice Line I pass the variable X= Purchase Invoice Line. Amout. X is the Lines Total. So If My Purchase Invoice has 3 lines, the same variable X is repeated in all 3 Lines.

I pretend only the First Total. How can I do that?