Here you can find the source of getElementById(Document dom, String id, String localElementName)
public static Element getElementById(Document dom, String id, String localElementName)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static Element getElementById(Document dom, String id, String localElementName) { NodeList children = dom.getElementsByTagNameNS( "*", localElementName); //$NON-NLS-1$ for (int i = 0; i < children.getLength(); i++) { Element element = (Element) children.item(i); if (element.getAttribute("id").equals(id)) { return element; }// ww w .j av a2 s .c o m } // non found. return null; } }