protected final java.lang.Object iterateReader(XMLStreamReader toReader, java.lang.Object toObject, XMLFormatType toFormatType)
    {
        java.lang.Object loReturn = null;
        try
        {   while(toReader.hasNext())
            {
                switch(toReader.getEventType())
                {
                    case XMLStreamConstants.START_ELEMENT:
                    {
                        int lnAttributeCount = toReader.getAttributeCount();
                        // Get all of the attributes from this  element
                        PropertySet loAttributes = new PropertySet(lnAttributeCount);
                        for (int i=0; i< lnAttributeCount; i++)
                        {
                            loAttributes.put(toReader.getAttributeLocalName(i), toReader.getAttributeValue(i));
                        }
                        loReturn = startedElement(toReader, toReader.getLocalName(), loAttributes, toObject, toFormatType);
                        if (loReturn != null)
                        {
                            return loReturn;
                        }
                        break;
                    }
                    case XMLStreamConstants.END_ELEMENT:
                    {
                        if (toObject == null || (toObject != null && isEndingElement(toReader.getLocalName(), toObject, toFormatType)))
                        {
                            return toObject;
                        }
                        break;
                    }
                    default:
                        break;
                }
                toReader.next();
            }
        }
        catch (Throwable ex)
        {
            Application.getInstance().log(ex);
        }
        return loReturn;
    }