Possible Duplicate:
How to read an XML file with Java?
CLOSED
Possible Duplicate:
How to read an XML file with Java?
CLOSED
There's only one element with grantee-template
tag name. You seem to expect two. What you are really look for is its two children.
Replace your first statement
NodeList granteeTemplate = doc.getElementsByTagName("grantee-template")
with
NodeList granteeTemplate=doc.getDocumentElement().getChildNodes();