Code example for Element

Methods: appendChild, getOwnerDocument

0
	 * @param root Element to append data to 
	 * @param renditionName Name to assign element 
	 * @return XML Element representing the object  
	 */ 
	public Element appendXml(Element root, String renditionName) {
		Document doc = root.getOwnerDocument();
		 
		if(renditionName == null){
			// ToDo - is this right? 
			renditionName = "iosRendition";
		} 
		 
		Element renditionElement = doc.createElement(renditionName);
		root.appendChild(renditionElement);
		 
		if(url != null){
			Element urlElement = doc.createElement("url");
			urlElement.appendChild(doc.createTextNode(url));
			renditionElement.appendChild(urlElement);
		}