public static Node followLocalXpath (Node start, String localXpath) throws DOMException {
        String startXpath = localXpath(start);
        if (startXpath.equals(localXpath)) {
            return  start;
        }
        else {
            StringTokenizer tokenizer = new StringTokenizer(localXpath, "[]");
            if (tokenizer.countTokens() != 2) {
                String invalidXpath = localXpath + " is an invalid local Xpath!";
                throw  new DOMException(DOMException.SYNTAX_ERR, invalidXpath);
            }
            String tagname = tokenizer.nextToken();
            try {
                Integer position = new Integer(tokenizer.nextToken());
                int counter = 1;
                NodeList children = start.getChildNodes();
                for (int i = 0; i < children.getLength(); i++) {
                    Node child = children.item(i);
                    if (tagname.equals(child.getLocalName())) {
                        if (counter == position.intValue()) {
                            return  child;
                        }
                        counter++;
                    }
                }
            } catch (NumberFormatException excpt) {
                String invalidXpath = localXpath + " is an invalid local Xpath!";
                throw  new DOMException(DOMException.SYNTAX_ERR, invalidXpath);
            }
            String failed = "No node at location " + localXpath;
            throw  new DOMException(DOMException.NOT_FOUND_ERR, failed);
        }
    }