public void parseAttributeElements(Element element, Object target, IElementParser parser) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException, InstantiationException, ClassNotFoundException {
        Class clazz = target.getClass();
        NodeList children = element.getChildNodes();
        for (int i = 0; i < children.getLength(); i++) {
            Node node = children.item(i);
            if (!(node instanceof Element)) {
                continue;
            }
            Element child = (Element) node;
            if (!checkAttributeNode(clazz, child)) {
                continue;
            }

            String attributeName = child.getTagName().substring(clazz.getSimpleName().length() + 1);

            if (child.hasChildNodes()) {
                // Assert we only have one child.
                assert (child.getFirstChild() == child.getLastChild());

                Node valueNode = child.getFirstChild();
                if (valueNode instanceof Element) {
                    // Load element node (use direct setter)
                    Object value = parser.parseElement((Element) child.getFirstChild());
                    parseAttribute(target, clazz, attributeName, true, value);
                }
                if (valueNode instanceof Text) {
                    // Load text content (use IConverter)
                    parseAttribute(target, clazz, attributeName, false, child.getTextContent());
                } else {
                    throw new IllegalStateException();
                }
            } else {
                parseAttribute(target, clazz, attributeName, true, null);
            }
        }
    }