I am trying to pull elements out of a parsed XML file by searching a specific node from a NodeList. This is the following code I am using to iterate through multiple parents:
Node node;
NodeList nodeList = document.getElementsByTagName("SomeTag");
for (int i = 0; i < nodeList.getLength(); i++)
{
NamedNodeMap map = nodeList.item(i).getAttributes();
node = map.getNamedItem("AnotherTag")
}
However, my node always returns null. When doing some debugging, it appears it has all the values:

I think it has to do something with the “this$0” reference to itself before I get to the values, because if i do a getLength of the NodeMap, it returns 0. Any thought on how to fix this? Thanks a bunch everyone!
You are accessing the attributes of an element, not its sub-nodes by calling
nodeList.item(i).getAttributes();