The NodeList implementation is not thread safe. When iterating through children of a particular node, the NodeList gets changed by another thread doing the same action. As a result I get a NullPointerException sometimes and some other times I get "wrong document error" when I try to append this clone a child node to a document. The first implementation to access children of a node does not work. NodeList childList=root.getChildNodes(); for (int i=0; i<childList.getLength(); i++) { // doing something here with "childList.item(i)" } The second implementation to access children of a node works. Node currChildNode = root.getFirstChild(); while(currChildNode != null) { // Do something here with the "currChildNode" currChildNode = currChildNode.getNextSibling(); }