*
* @throws OMException
*/
public Iterator getChildrenWithName(QName elementQName) {
OMNode firstChild = getFirstOMChild();
Iterator it = new OMChildrenQNameIterator(firstChild, elementQName);
// The getChidrenWithName method used to tolerate an empty namespace
// and interpret that as getting any element that matched the local
// name. There are custmers of axiom that have hard-coded dependencies
// on this semantic.
// The following code falls back to this legacy behavior only if
// (a) elementQName has no namespace, (b) the new iterator finds no elements
// and (c) there are children.
if (elementQName.getNamespaceURI().length() == 0 &&
firstChild != null &&
!it.hasNext()) {
if (log.isTraceEnabled()) {
log.trace("There are no child elements that match the unqualifed name: " +
elementQName);
log.trace("Now looking for child elements that have the same local name.");
}