attributes.put(atts.getLocalName(i), atts.getValue(i));
attributeNamespaces.put(atts.getLocalName(i), atts.getURI(i));
}
}
final Node newElement;
if (namespaceURI.length() == 0) {
newElement = new Node(currentNode, qName, attributes, attributeNamespaces, namespaceURI);
} else {
newElement = new Node(currentNode, localName, attributes, attributeNamespaces, namespaceURI);
}
if (currentNode != null) {
currentNode.addChild(newElement);
}