public void convertChannelToHtml(XmlPullParser parser, XmlSerializer writer)
        throws IOException, XmlPullParserException
    {
        // <!ELEMENT channel (title | description | link | language | item+ | rating? | image? | textinput? | copyright? | pubDate? | lastBuildDate? | docs? | managingEditor? | webMaster? | skipHours? | skipDays?)*>
        boolean seenBody = false; //assumption that title is before items ...
        while (parser.nextTag() != XmlPullParser.END_TAG) { // this guranteed by well formednes of XML && parser.getName().equals("channel"))) {
            // if (parser.getEventType() == XmlPullParser.START_TAG) { //guranteed by nextTag
            // <!ELEMENT title (#PCDATA)>
            if(parser.getName().equals("title") && !seenBody) {
                writer.startTag(null,"head");
                writer.startTag(null,"title").text(parser.nextText()).endTag(null,"title");
                writer.endTag(null,"head");
            } else if(parser.getName().equals("item")) {
                if(!seenBody) {
                    writer.startTag(null, "body");
                    seenBody = true;
                }
                convertItemToHtml(parser, writer);
            } else {
                // skip any element content including sub elements...
                int level = 1;
                while (level > 0) {
                    switch(parser.next()) {
                        case XmlPullParser.START_TAG: ++level; break;
                        case XmlPullParser.END_TAG: --level; break;
                    }
                }
            }
        }
        if(seenBody) writer.endTag(null, "body");
    }