private String getElementsValueByTag(String tagName, Element root) {
		String result = null;
		if (root == null) {
			return null;
		}
		NodeList nodes = root.getElementsByTagName(tagName);
		if (nodes == null || nodes.getLength() == 0) {
			result = root.getAttribute(tagName);
			return result;
		}
		int len = nodes.getLength();
		for (int i = 0; i < len; i++) {
			try {
				Element element = (Element) nodes.item(i);
				if (element.getNodeType() == Node.ELEMENT_NODE) {
					result = element.getChildNodes().item(0).getNodeValue();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}
		return result;
	}