public static XmlNode scanNode(final XmlPullParser parser) throws XmlPullParserException, IOException {
        if (parser.getEventType() != XmlPullParser.START_TAG) {
            throw new XmlPullParserException("Not a start tag: " + parser);
        }
        final XmlNode node = new XmlNode(parser.getName(), parser.getNamespace());
        for (int i = 0; i < parser.getAttributeCount(); i++) {
            final XmlNode attNode = new XmlNode(ATTRIBUTE_PRAEFIX + parser.getAttributeName(i), parser.getAttributeNamespace(i));
            attNode.setValue(parser.getAttributeValue(i));
            node.add(attNode);
        }

        while (true) {
            switch (parser.next()) {
                case XmlPullParser.END_TAG:
                    return node;
                case XmlPullParser.START_TAG:
                    node.add(scanNode(parser));
                    break;
                case XmlPullParser.TEXT:
                    node.setValue(parser.getText());
                    break;
                default:
                    throw new XmlPullParserException("Unexpected element tyoe: " + parser.getEventType());
            }
        }
    }
Scans an XMLNode from a Pull Parser.
Pull Parser has to be placed upon a START_TAG element.
When this method returns, pull parser will be placed on the corresponding END_TAG element.
main/src/main/java/cgeo/geocaching/utils/xml/XmlNode.java