Java tutorial
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static byte getByteValue(Element paramElement) { return Byte.valueOf(getText(paramElement)).byteValue(); } public static String getText(Element paramElement) { NodeList localNodeList = paramElement.getChildNodes(); int i = localNodeList.getLength(); for (int j = 0; j < i; ++j) { Node localNode = localNodeList.item(j); if (localNode.getNodeType() == 3) return localNode.getNodeValue(); } return ""; } }