I want to select only the first occurrence of codes.head with md.mnem="ht1" and "ht1c" tag from the whole file, regardless of its parent.
My Xml file looks like this-

```
<printArtifactGroup>
    <!--Pubtags   : [ANIP+, AN+, ANIP, AN]Sourcetags: [21, 21-A1]-->
    <bov ID="I2C37E8404E1711DF8062B84BC6F3033A" legacy.identifier="000321783">
        <placeholder ID="I2C3836604E1711DF8062B84BC6F3033A" md.mnem="vols">
            <placeholder.text>0390 V. 0390 Ch. 75, Arts. 42-end (2008)</placeholder.text>
        </placeholder>
        <head.block ID="I2C385D704E1711DF8062B84BC6F3033A">
            <codes.head ID="I2C385D714E1711DF8062B84BC6F3033A" md.mnem="ht1">
                <head.info>
                    <headtext>
                        <ital>Wests pso1_1</ital>
                    </headtext>
                </head.info>
            </codes.head>
            <codes.head ID="I2C385D724E1711DF8062B84BC6F3033A" md.mnem="ht1c">
                <head.info>
                    <headtext> pso1_2</headtext>
                </head.info>
            </codes.head>
            <placeholder ID="I2C3920C14E1711DF8062B84BC6F3033A" md.mnem="angen">
                <placeholder.text>UL</placeholder.text>
            </placeholder>
        </head.block>
        <head.block ID="I2C38D2A24E1711DF8062B84BC6F3033A">
            <codes.head ID="I2C38F9B04E1711DF8062B84BC6F3033A" md.mnem="hg2">
                <head.info>
                    <label.name>CHAPTER</label.name>
                    <label.designator>75 pso1_4</label.designator>
                </head.info>
            </codes.head>
            <codes.head ID="I2C38F9B04E1711DF8062B84BC6F3033A" md.mnem="hg2">
                <head.info>
                    <label.name>CHAPTER duplicate</label.name>
                    <label.designator>75 pso1_5</label.designator>
                </head.info>
            </codes.head>
            <codes.head ID="I2C38F9B14E1711DF8062B84BC6F3033A" md.mnem="hg2c">
                <head.info>
                    <headtext> pso1_6</headtext>
                </head.info>
            </codes.head>
            <placeholder ID="I2C3920C14E1711DF8062B84BC6F3033A" md.mnem="angen">
                <placeholder.text>UL</placeholder.text>
            </placeholder>
        </head.block>
    </bov>
    <grade.content legacy.identifier="018840438" ID="I2C3158904E1711DFAB97E78B3969CA63">
        <head.block ID="I2C31CDC04E1711DFAB97E78B3969CA63">
            <codes.head ID="I2C385D714E1711DF8062B84BC6F3033A" md.mnem="ht1">
                <head.info>
                    <headtext>
                        <ital>pso1</ital>
                    </headtext>
                </head.info>
            </codes.head>
            <codes.head ID="I2C385D724E1711DF8062B84BC6F3033A" md.mnem="ht1c">
                <head.info>
                    <headtext>pso2</headtext>
                </head.info>
            </codes.head>
            <codes.head ID="I2C385D724E1711DF8062B84BC6F3033A" md.mnem="srnl">
                <head.info>
                    <headtext>pso 4</headtext>
                </head.info>
            </codes.head>
        </head.block>
    </grade.content>
</printArtifactGroup>

```

My XSLT scripts is -

```
<xsl:template match="codes.head">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template
            match="codes.head[@md.mnem[starts-with(.,'ht1')]][position() > 2]"/>

```

the output i'm getting

```
<?xml version="1.0" encoding="UTF-8"?>
<printArtifactGroup><!--Pubtags   : [ANIP+, AN+, ANIP, AN]Sourcetags: [21, 21-A1]-->
   <bov ID="I2C37E8404E1711DF8062B84BC6F3033A" legacy.identifier="000321783">
      <placeholder ID="I2C3836604E1711DF8062B84BC6F3033A" md.mnem="vols">
         <placeholder.text>0390 V. 0390 Ch. 75, Arts. 42-end (2008)</placeholder.text>
      </placeholder>
      <head.block ID="I2C385D704E1711DF8062B84BC6F3033A">
         <codes.head ID="I2C385D714E1711DF8062B84BC6F3033A" md.mnem="ht1">
            <head.info>
               <headtext>
                  <ital>Wests pso1_1</ital>
               </headtext>
            </head.info>
         </codes.head>
         <codes.head ID="I2C385D724E1711DF8062B84BC6F3033A" md.mnem="ht1c">
            <head.info>
               <headtext> pso1_2</headtext>
            </head.info>
         </codes.head>
         <placeholder ID="I2C3920C14E1711DF8062B84BC6F3033A" md.mnem="angen">
            <placeholder.text>UL</placeholder.text>
         </placeholder>
      </head.block>
      <head.block ID="I2C38D2A24E1711DF8062B84BC6F3033A">
         <codes.head ID="I2C38F9B04E1711DF8062B84BC6F3033A" md.mnem="hg2">
            <head.info>
               <label.name>CHAPTER</label.name>
               <label.designator>75 pso1_4</label.designator>
            </head.info>
         </codes.head>
         <codes.head ID="I2C38F9B04E1711DF8062B84BC6F3033A" md.mnem="hg2">
            <head.info>
               <label.name>CHAPTER duplicate</label.name>
               <label.designator>75 pso1_5</label.designator>
            </head.info>
         </codes.head>
         <codes.head ID="I2C38F9B14E1711DF8062B84BC6F3033A" md.mnem="hg2c">
            <head.info>
               <headtext> pso1_6</headtext>
            </head.info>
         </codes.head>
         <placeholder ID="I2C3920C14E1711DF8062B84BC6F3033A" md.mnem="angen">
            <placeholder.text>UL</placeholder.text>
         </placeholder>
      </head.block>
   </bov>
   <grade.content legacy.identifier="018840438" ID="I2C3158904E1711DFAB97E78B3969CA63">
      <head.block ID="I2C31CDC04E1711DFAB97E78B3969CA63">
         <codes.head ID="I2C385D714E1711DF8062B84BC6F3033A" md.mnem="ht1">
            <head.info>
               <headtext>
                  <ital>pso1</ital>
               </headtext>
            </head.info>
         </codes.head>
         <codes.head ID="I2C385D724E1711DF8062B84BC6F3033A" md.mnem="ht1c">
            <head.info>
               <headtext>pso2</headtext>
            </head.info>
         </codes.head>
         <codes.head ID="I2C385D724E1711DF8062B84BC6F3033A" md.mnem="srnl">
            <head.info>
               <headtext>pso 4</headtext>
            </head.info>
         </codes.head>
      </head.block>
   </grade.content>
</printArtifactGroup>

```

This is keeping all the first occurrence of ht1 and ht1c in every block not in the whole file. What should be the correct way to select only the first occurrence in the whole file?

desired output

```
<?xml version="1.0" encoding="UTF-8"?>
<printArtifactGroup><!--Pubtags   : [ANIP+, AN+, ANIP, AN]Sourcetags: [21, 21-A1]-->
   <bov ID="I2C37E8404E1711DF8062B84BC6F3033A" legacy.identifier="000321783">
      <placeholder ID="I2C3836604E1711DF8062B84BC6F3033A" md.mnem="vols">
         <placeholder.text>0390 V. 0390 Ch. 75, Arts. 42-end (2008)</placeholder.text>
      </placeholder>
      <head.block ID="I2C385D704E1711DF8062B84BC6F3033A">
         <codes.head ID="I2C385D714E1711DF8062B84BC6F3033A" md.mnem="ht1">
            <head.info>
               <headtext>
                  <ital>Wests pso1_1</ital>
               </headtext>
            </head.info>
         </codes.head>
         <codes.head ID="I2C385D724E1711DF8062B84BC6F3033A" md.mnem="ht1c">
            <head.info>
               <headtext> pso1_2</headtext>
            </head.info>
         </codes.head>
         <placeholder ID="I2C3920C14E1711DF8062B84BC6F3033A" md.mnem="angen">
            <placeholder.text>UL</placeholder.text>
         </placeholder>
      </head.block>
      <head.block ID="I2C38D2A24E1711DF8062B84BC6F3033A">
         <codes.head ID="I2C38F9B04E1711DF8062B84BC6F3033A" md.mnem="hg2">
            <head.info>
               <label.name>CHAPTER</label.name>
               <label.designator>75 pso1_4</label.designator>
            </head.info>
         </codes.head>
         <codes.head ID="I2C38F9B04E1711DF8062B84BC6F3033A" md.mnem="hg2">
            <head.info>
               <label.name>CHAPTER duplicate</label.name>
               <label.designator>75 pso1_5</label.designator>
            </head.info>
         </codes.head>
         <codes.head ID="I2C38F9B14E1711DF8062B84BC6F3033A" md.mnem="hg2c">
            <head.info>
               <headtext> pso1_6</headtext>
            </head.info>
         </codes.head>
         <placeholder ID="I2C3920C14E1711DF8062B84BC6F3033A" md.mnem="angen">
            <placeholder.text>UL</placeholder.text>
         </placeholder>
      </head.block>
   </bov>
   <grade.content legacy.identifier="018840438" ID="I2C3158904E1711DFAB97E78B3969CA63">
      <head.block ID="I2C31CDC04E1711DFAB97E78B3969CA63">
         <codes.head ID="I2C385D724E1711DF8062B84BC6F3033A" md.mnem="srnl">
            <head.info>
               <headtext>pso 4</headtext>
            </head.info>
         </codes.head>
      </head.block>
   </grade.content>
</printArtifactGroup>

```