XmlPath xmlPath = XmlPathParser.parse(xmlPathQuery);
XmlNode node;
while((node = pullXmlNode()) != null) {
if(node instanceof XmlStartElement) {
XmlStartElement startElement = (XmlStartElement) node;
Element element = new Element(startElement.getLocalName());
element.addAttributes(startElement.getAttributes());
currentPath.addLast(element);
if(xmlPath.matches(currentPath)) {
nodeQueue.push(node);
currentPath.removeLast();
return true;