Element employee = new Element("employee"); employee.setText("John Doe");
Element age = new Element("age"); age.setText("30");In the above example, a new element named "age" is created and the text content is set as "30" using the setText method. The org.jdom package library is a Java-based XML library that provides the ability to read, write, and manipulate XML documents.