Element root = doc.createElement("person"); // Create Root Element
Element item = doc.createElement("name"); // Create element
item.appendChild( doc.createTextNode("Jeff") );
root.appendChild( item ); // atach element to Root element
item = doc.createElement("age"); // Create another Element
item.appendChild( doc.createTextNode("28" ) );
root.appendChild( item ); // Attach Element to previous element down tree
item = doc.createElement("height");
item.appendChild( doc.createTextNode("1.80" ) );
root.appendChild( item ); // Attach another Element - grandaugther
doc.appendChild( root ); // Add Root to Document