code: public static Node createTextNode(String tagName, Object contents)
      {
          Document d = XmlUtils.getDefaultDocument();
          Element node = d.createElement(tagName);
          node.appendChild(d.createTextNode(String.valueOf(contents)));
          return node;
      }
docs: Creates an XML node from the
  {@link #getDefaultDocument() default document} whose only child
  is a text node that contains the string representation of the
  given object
  
  @param tagName The tag name for the node
  @param contents The object whose string representation will be
  the contents of the text node
  @return The node