static Provider parseProvider(XmlIterator xpi) 
    throws IOException, MC2ParserException {
        
        final int round;
        CharArray ca = xpi.attributeCharArray(MC2Strings.around);
        if (ca != null) {
            round = ca.intValue();
        } else {
            throw new MC2ParserException("No round attribute");
        }
        
        final int heading;
        ca = xpi.attributeCharArray(MC2Strings.aheading);
        if (ca != null) {
            heading = ca.intValue();
        } else {
            throw new MC2ParserException("No heading attribute");
        }
        
        xpi.children();
        String name = xpi.value();
        int topRegionID = Provider.ALL_REGIONS;
        String imageName = null;
        String type = null;
        while (xpi.advance()) {
            if (xpi.nameRefEq(MC2Strings.ttype)) {
                type = xpi.value();
            } else if (xpi.nameRefEq(MC2Strings.ttop_region_id)) {
                topRegionID = xpi.valueCharArray().intValue();
            } else if (xpi.nameRefEq(MC2Strings.timage_name)) {
                imageName = xpi.value();
            }
        }
        if(imageName == null) {
            imageName = "";
        }
        if(type == null) {
            type = "";
        }
        
        return new Provider(round, heading, name, type, topRegionID, imageName);
    }