AttributesImpl atts = new AttributesImpl();
atts.addAttribute("", "", "hat", "CDATA", "new");
atts.addAttribute("", "", "car", "CDATA", "Honda");
atts.addAttribute("", "", "dog", "CDATA", "Boxer");
doc.startElement("","B","B", atts);
text="Life is good";
doc.characters(text.toCharArray(),0,text.length());
doc.endElement("","B","B");
doc.endElement("","A","A");