code: protected Element createAndAppendTextElementCheckNull(Document doc, Element parent,
  			String elName, Object value) {
  
  		if (doc == null
  				|| parent == null || elName == null) {
  			throw new NullPointerException("bad parameters given");
  		}
  
  		if (value == null) {
  			throw new NullPointerException("null is not allowed for "
  					+ elName
  					+ " in " + doc.getFirstChild().getLocalName());
  		}
  
  		String valueStr = value.toString();
  		if (valueStr == null) {
  			throw new NullPointerException("null-string not allowed for "
  					+ elName
  					+ " in " + doc.getFirstChild().getLocalName());
  		}
  
  		Element child = createAndAppendElement(doc, parent, elName);
  		Text txtcElement = doc.createTextNode(valueStr);
  		child.appendChild(txtcElement);
  		return child;
  	}
docs: Helper to create a new element with name elName and append it to the {@link Element} given by parent. The new
  {@link Element} will have {@link Text} node containing value.
  
  @param doc
  {@link Document} where parent is located in
  @param parent
  where to append the new element
  @param elName
  the name of the new element.
  @param value
  the value of the {@link Text} node appended to the new element,
  using toString() on the object.
  is null
  @return the new {@link Element}