protected static Element getById(String id, Node node) {
if (!(node instanceof ElementWithID)) {
return null;
}
ElementWithID e = (ElementWithID)node;
if (e.getID().equals(id)) {
return (Element)e;
}
for (Node n = node.getFirstChild();
n != null;
n = n.getNextSibling()) {