public class OMChildrenWithSpecificAttributeIteratorTest extends TestCase {
public void testChildrenRetrievalWithDetaching() {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace testNamespace = factory.createOMNamespace("http://test.ws.org", "test");
OMElement documentElement = getSampleDocumentElement(testNamespace);
Iterator childrenIter = new OMChildrenWithSpecificAttributeIterator(
documentElement.getFirstOMChild(),
new QName(testNamespace.getNamespaceURI(), "myAttr",
testNamespace.getPrefix()), "Axis2", true);
int childCount = getChidrenCount(childrenIter);
assertEquals("Iterator must return 5 children with the given attribute", childCount, 5);
Iterator children = documentElement.getChildren();