# Filtering elements within XML

**URL:** <https://forum.kirupa.com/t/filtering-elements-within-xml/255613>\
**Category:** Uncategorized\
**Created:** [March 25, 2008, 10:54am UTC](https://forum.kirupa.com/t/filtering-elements-within-xml/255613 "2008-03-25T10:54:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoolagon](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@hoolagon](https://forum.kirupa.com/u/hoolagon)\
**Post date:** [March 25, 2008, 10:54am UTC](https://forum.kirupa.com/t/filtering-elements-within-xml/255613/1 "2008-03-25T10:54:48Z")

</div>

Just been looking at senocular’s XML tutorial.  
It tells me I can filter through my xml using something like this, to  
output the nodes with the attribute value of 1.

trace(grades.student.quiz.(@num == “1”));

However this is not quite what I’m after. Not all my xml nodes have the same attributes and so I need a way to  
search or filter through my xml and get the nodes which have the @num attribute or which ever attribute I am looking for.

Im sure this is pretty basic stuff, but dont know the syntax I need to use.

Thanks in advance,

Julian
