Instead of using $root->children just use $root->children( 'ds') which will give you only the ds children, in the document order.
All navigation methods (children, first_child, next_sibling, descendants...) accept an extra argument, a condition used to filter results. See the module doc (which I admit is pretty huge and hard to navigate) for more info.
In reply to Re: XML Twig parse
by mirod
in thread XML Twig parse
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |