OK, by running the same test as an AndroidTestCase the NPE is raised for Text temp = doc.createTextNode(null);  We're getting closer. Next thing maybe to read the documents for doc.createTextNode(...) on the Android site. We also need to add some guard code so this method isn't called with null.