oh I misread! I wonder if we need this somewhere else and if we could represent this as an object ie something like this:
```

public class XContentStructure {
    public XContentStructure( XContentParser parser, WhaterverWeNeedHere ) {
        // copy current struct...
     } 

     public Query asQuery(String...types) {
        //... do it
     }

     public Filter asFilter(String...types) {
        //... do it
     }
}
```
does this make sense?