int nbrNodes = nodeList.getLength();
if (nbrNodes != 0) {
for (int index = 0; index < nbrNodes; index++) {
root.removeChild(nodeList.item(0));
if (root.getFirstChild().getNodeType() == Node.TEXT_NODE) {
root.removeChild(root.getFirstChild());
}
}
String str;
str = xmlToString(document);
FileWriter fw = new FileWriter(xmlFile);