Java Programming John Doe
Node titleNode = xmlDoc.getElementsByTagName("title").item(0); String titleContent = titleNode.getTextContent();
John Doe
Node employeeNode = xmlDoc.getElementsByTagName("employee").item(0); String idContent = employeeNode.getAttributes().getNamedItem("id").getTextContent();Package/Library: This functionality is provided by the Java DOM API. No external package or library is required to use this method.