In a nutshell, I'm wondering just how this can be done, since there doesn't (As far as I know) seem to be a way to do this with PHP's SimpleXMLObject setup.
Here's my xml:
<main>
<item><field>1</field></item>
<item><field>2</field></item>
<item><field>2</field></item>
<item><field>4</field></item>
</main>
I'm trying to have it so that only enteries that match the field value of 2 would be returned in a new xml object. The problem is being able to filter out what doesn't match. I've tried using unset, but it only seems to return an object with t and e as enteries. Is there a better solution for what seems to be a simple request?