# Filtering XML

**URL:** <https://forum.kirupa.com/t/filtering-xml/270981>\
**Category:** flash\
**Created:** [September 17, 2008, 2:55am UTC](https://forum.kirupa.com/t/filtering-xml/270981 "2008-09-17T02:55:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwiniquit](https://avatars.discourse-cdn.com/v4/letter/i/7993a0/32.png) [@iwiniquit](https://forum.kirupa.com/u/iwiniquit)\
**Post date:** [September 17, 2008, 2:55am UTC](https://forum.kirupa.com/t/filtering-xml/270981/1 "2008-09-17T02:55:25Z")

</div>

I’m trying to figure out how to sort/filter through XML entries. Basically what I’m trying to do is output(trace) all of the movies that have a movie\_type.type of 1. This would output all the info in Movie One and Movie Three. How would I go about searching through all of the types. Would I have to use a loop of some sort? My logic (which is wrong) thought it would be something like this:

```auto
movie_list.movie.(movie_type.type == 1)
// or
movie_list.movie.(movie_type.* == 1)

```

```auto
<movie_list>
    <movie>
        <movie_name>Movie One</movie_name>
        <movie_id>1</movie_id>
        <movie_type>
            <type>1</type>
            <type>3</type>
            <type>4</type>
        </movie_type>
    </movie>
    <movie>
        <movie_name>Movie Two</movie_name>
        <movie_id>2</movie_id>
        <movie_type>
            <type>2</type>
        </movie_type>
    </movie>
    <movie>
        <movie_name>Movie Three</movie_name>
        <movie_id>3</movie_id>
        <movie_type>
            <type>4</type>
            <type>1</type>
        </movie_type>
    </movie>
</movie_list>

```

So is there any way to do this or do I have to use a for loop of some sort?

Any help would be greatly appreciated.
