private void createElement(Document doc,Element parentElement,String elementName,Font value){
  Element element=doc.createElement(elementName);
  element.setAttribute(FONT_SIZE,Integer.toString(value.getSize()));
  element.setAttribute(FONT_STYLE,Integer.toString(value.getStyle()));
  element.appendChild(doc.createTextNode(value.getName()));
  parentElement.appendChild(element);
}

private void createElement ( Document doc , Element parentElement , String elementName , Font value ) { Element element = doc . createElement ( elementName ) ; element . setAttribute ( FONT_SIZE , Integer . toString ( value . getSize ( ) ) ) ; element . setAttribute ( FONT_STYLE , Integer . toString ( value . getStyle ( ) ) ) ; element . appendChild ( doc . createTextNode ( value . getName ( ) ) ) ; parentElement . appendChild ( element ) ; }
creates the xml element for a font value .
