private void parseSearchAreas(XmlIterator xpi,
                                  AddressInfoImpl address)
        throws IOException {

        /* <!ELEMENT search_area ( name,
         *                         areaid,
         *                         location_name?,
         *                         lat?, lon?, boundingbox?,
         *                         top_region_id?,
         *                         search_area* )>
         *                         
         * <!ATTLIST search_area search_area_type %search_area_type_t; #REQUIRED>
         */        

        String type = xpi.attribute(MC2Strings.asearch_area_type); // can be null
        xpi.children(); // empty search_area not allowed
        String name = EMPTY;
        String topRegionID = EMPTY;
        do {
            if (xpi.nameRefEq(MC2Strings.tname)) {
                name = xpi.value();
            } else if (xpi.nameRefEq(MC2Strings.ttop_region_id)) {
                topRegionID = xpi.value();
            } else if (xpi.nameRefEq(MC2Strings.tsearch_area)) {
                parseSearchAreas(xpi, address);
            }
        } while (xpi.advance());
        
        // note: will print from deepest level, e.g. country first.
        if(LOG.isDebug()) {
            LOG.debug("ExpandMC2Request.parseSearchAreas()",
                      "name=" + name + " type=" + type);
        }

        // readability suffers if we use MC2Strings.enumType() since
        // we don't have good constants for search_area types.
        if ("city".equals(type)) {
            address.setCity(name);
        } else if ("citypart".equals(type)) {
            address.setCityPart(name);
        } else if ("country".equals(type)) {
            // the server will not send a country without a top region ID
            address.setTopRegion(name, topRegionID);
        } else if ("municipal".equals(type)) {
            address.setMunicipal(name);
        }
    }