rootElement = stAXOMBuilder.getDocumentElement();
assertTrue("Root element can not be null", rootElement != null);
assertTrue(" Name of the root element is wrong",
rootElement.getLocalName().equalsIgnoreCase("Root"));
// get the first OMElement child
OMNode omnode = rootElement.getFirstOMChild();
while (omnode instanceof OMText) {
omnode = omnode.getNextOMSibling();
}
Iterator children = ((OMElement) omnode).getChildren();
int childrenCount = 0;
while (children.hasNext()) {
OMNode node = (OMNode) children.next();
if (node instanceof OMElement)
childrenCount++;
}
assertTrue(childrenCount == 5);
}