I'd like to filter XML elements out of a response with XSLT 3 with Saxon HE 10.6

```
<!-- https://mvnrepository.com/artifact/net.sf.saxon/Saxon-HE -->
<dependency>
    <groupId>net.sf.saxon</groupId>
    <artifactId>Saxon-HE</artifactId>
    <version>10.6</version>
</dependency>

```

I saved cases on <https://xsltfiddle.liberty-development.net/3MP42Pc> and <https://xsltfiddle.liberty-development.net/3MP42Pc/1>

I was hoping to be able to use

```
<xsl:mode on-no-match="shallow-skip" />

```

(that is: skip elements the do not match a filter.)

So I want to copy all elements that match some deeper attribute value

The structure is like a dataset of shoes with a status, appearing like generic items on a bill.

bill.xml

```
  <bill>
    <item>
      <shoes>
        <status>0</status>
      </shoes>
    </item>
    <item>
      <shoes>
        <status>1</status>
      </shoes>
    </item>
    <item>
      <shoes>
        <status>2</status>
      </shoes>
    </item>
  </bill>

```

I want the generic items (of any kind (shoes)) with status=0

(otherwise said: skip items where '\*/[status=0'] does not match)

bill.xslt

```
<xsl:stylesheet version="3.0">
  <xsl:mode on-no-match="shallow-skip" />
  <xsl:template match="item/*[status=0]"/>
</xsl:stylesheet>

```

The result would have to be

```
<bill>
  <item>
    <shoes><status>0</status></shoes>
  </item>
</bill>

```

Alas, this script finds nothing

But. In the case of

```
<xsl:mode on-no-match="shallow-copy" />

```

It finds (as expected) all items that are not status=0

```
<bill>
  <item/>
  <item>
    <shoes><status>1</status></shoes>
  </item>
  <item>
    <shoes><status>2</status></shoes>
  </item>
</bill>

```

If i use

```
<xsl:mode on-no-match="deep-copy" />

```

It finds all of the items (no filtering).

It seems not very logical to me, even though an item element has the context.

I use SAXON HE version 10.6, the only difference in the code with javax.xml.transform is the use of

```
TransformerFactory factory = new **BasicTransformerFactory**();

```

Question is how to make an elegant small script that does this: output the whole xml, skipping the items that do not match.