private Iterator detailChildrenIterator(Detail detail) {
        /*
        sb.append("<ns2:AccessDeniedWebServiceException xmlns:ns2=\"http://exceptionthrower.system.services.v4_0.soap.server.nameapi.org/\">");
        sb.append("<blame>CLIENT</blame>");
        sb.append("<errorCode>2101</errorCode>");
        sb.append("<faultCause>AccessDenied</faultCause>");
         */

        DetailEntry firstDetailEntry = getFirstDetailEntry(detail);
        if (firstDetailEntry!=null) {
            String localName = firstDetailEntry.getElementName().getLocalName();
            if (localName.endsWith("Exception")) {
                //got a subtag
                return firstDetailEntry.getChildElements();
            }
        }
        return detail.getDetailEntries();
    }
private Iterator detailChildrenIterator ( Detail detail ) { DetailEntry firstDetailEntry = getFirstDetailEntry ( detail ) ; if ( firstDetailEntry != null ) { String localName = firstDetailEntry . getElementName ( ) . getLocalName ( ) ; if ( localName . endsWith ( "Exception" ) ) { return firstDetailEntry . getChildElements ( ) ; } } return detail . getDetailEntries ( ) ; }
It can either e within an extra tag, or directly.