} while (parent != null);
// Remove the fake parent node if there is one.
Node top = (Node) stack.peek();
if (top instanceof Element && ((Element) top).getName() == null) {
stack.pop();
}
StringBuffer path = new StringBuffer();
while (!stack.isEmpty()) {
Node pathNode = (Node) stack.pop();