import org.jdom.Attribute;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.DOMBuilder;
import java.io.File;
import java.util.List;

public class CloneAttrbute {
	public static void main(String[] args) {
		try {
			String data = "student.xml";
			File file = new File(data);
			DOMBuilder builder = new DOMBuilder(false);
			Document doc = builder.build(file);
			Element root = doc.getRootElement();
			List row = root.getChildren("info");
			for (int i = 0; i < row.size(); i++) {
				Element infoElenemt = (Element) row.get(i);
				List column = infoElenemt.getChildren("first");
				for (int j = 0; j < column.size(); j++) {
					Element student = (Element) column.get(j);
					String attribute = student.getAttribute("name").getValue();
					Attribute clonAttribute = (Attribute) student.getAttribute(
					"name").clone();
					System.out.println("Attribute Value : " + attribute);
					System.out.println("Clone of attribute : " + clonAttribute);
				}
			}
		} catch (Exception e) {
			System.out.println("Execption " + e.getMessage());
		}
	}
}