private Element appendElement(Element parent, String name, String text) {
    Document document = parent.getOwnerDocument();
    Element child = document.createElement(name);
    parent.appendChild(child);
    if (text != null) {
      Text textNode = document.createTextNode(text);
      child.appendChild(textNode);
    }
    return child;
  }
Generates hive-default.xml.template from HiveConf.ConfVars
common/src/java/org/apache/hadoop/hive/ant/GenHiveTemplate.java