everyone!

I’m facing the problem of getting data to create an object from the following XML file.

```
<staff>
<employee>
    <id>1</id>
    <firstName>John</firstName>
    <lastName>Smith</lastName>
    <country>USA</country>
    <age>25</age>
</employee>
<employee>
    <id>2</id>
    <firstName>Inav</firstName>
    <lastName>Petrov</lastName>
    <country>RU</country>
    <age>23</age>
</employee>

```

I can't get the value of the attribute through the method getAttributeValue().

all I got was to get the value in the format String with method getTextContent.

```
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = documentBuilder.parse("data.xml"); 
Node root = document.getDocumentElement(); 
NodeList staff = root.getChildNodes(); 
for (int i = 0; i < staff.getLength(); i++) {
Node employee = staff.item(i);

if (employee.getNodeType() != Node.TEXT_NODE) {
    NodeList employeeProps = employee.getChildNodes();
    for (int j = 0; j < employeeProps.getLength(); j++) {
        Node employeeProp = employeeProps.item(j);

        if (employeeProp.getNodeType() != Node.TEXT_NODE)
            employeeProp.getTextContent();
            // **TODO Employee?**

    }

}

```

tell me please how you can implement this idea, and still get the value to create an object of the class Employee?