public static void addAnnotationToXML(Element annotationsElement,String name,String value){
  if (value == null) {
    deleteAnnotationFromXML(annotationsElement,name);
  }
 else {
    final Document doc=annotationsElement.getOwnerDocument();
    Element elem=doc.createElement("annotation");
    annotationsElement.appendChild(elem);
    elem.setAttribute("key",name);
    elem.setTextContent(value);
  }
}

public static void addAnnotationToXML ( Element annotationsElement , String name , String value ) { if ( value == null ) { deleteAnnotationFromXML ( annotationsElement , name ) ; } else { final Document doc = annotationsElement . getOwnerDocument ( ) ; Element elem = doc . createElement ( "annotation" ) ; annotationsElement . appendChild ( elem ) ; elem . setAttribute ( "key" , name ) ; elem . setTextContent ( value ) ; } }
updates the xml representation to contain this annotation .
