Element pai= new Element("pai");
Element filho= new Element("filho");
for (int i=0;i<4;i++){
pai= new Element("pai");
filho.setText(""+i);
pai.addContent(filho);
}
mas to conceguindo nao… da dando o seguinte erro:
[color=darkred]Exception in thread “main” org.jdom.IllegalAddException: The Content already has an existing parent “pai”[/color]