public void endElement(
     String namespaceURI,
     String sName, // simple name
     String qName // qualified name
     ) throws SAXException {
   String element = qName;
   if (element.compareToIgnoreCase("presence") == 0) {}
   if (element.compareToIgnoreCase("presentity") == 0) {
     presenceTag.setPresentityTag(presentityTag);
   }
   if (element.compareToIgnoreCase("tuple") == 0) {
     presenceTag.addTupleTag(tupleTag);
   }
   if (element.compareToIgnoreCase("status") == 0) {
     tupleTag.setStatusTag(statusTag);
   }
   if (element.compareToIgnoreCase("basic") == 0) {
     statusTag.setBasicTag(basicTag);
   }
   if (element.compareToIgnoreCase("contact") == 0) {
     tupleTag.setContactTag(contactTag);
   }
   if (element.compareToIgnoreCase("note") == 0) {
     tupleTag.setNoteTag(noteTag);
   }
 }
 public void startElement(
     String namespaceURI,
     String lName, // local name
     String qName, // qualified name
     Attributes attrs)
     throws SAXException {
   element = qName;
   if (element.compareToIgnoreCase("presence") == 0) {
     presenceTag = new PresenceTag();
     String entity = attrs.getValue("entity").trim();
     presenceTag.setEntity(entity);
   }
   if (element.compareToIgnoreCase("presentity") == 0) {
     presentityTag = new PresentityTag();
     String id = attrs.getValue("id").trim();
     presentityTag.setId(id);
   }
   if (element.compareToIgnoreCase("tuple") == 0) {
     tupleTag = new TupleTag();
     String id = attrs.getValue("id").trim();
     tupleTag.setId(id);
   }
   if (element.compareToIgnoreCase("status") == 0) {
     statusTag = new StatusTag();
   }
   if (element.compareToIgnoreCase("basic") == 0) {
     basicTag = new BasicTag();
   }
   if (element.compareToIgnoreCase("contact") == 0) {
     contactTag = new ContactTag();
     String priority = attrs.getValue("priority").trim();
     if (priority != null) {
       try {
         contactTag.setPriority(Float.parseFloat(priority));
       } catch (Exception e) {
         e.printStackTrace();
       }
     }
   }
   if (element.compareToIgnoreCase("note") == 0) {
     noteTag = new NoteTag();
   }
 }