Here you can find the source of unmarshalDOMElement(byte[] input)
public static Element unmarshalDOMElement(byte[] input) throws SAXException, IOException, ParserConfigurationException
//package com.java2s; //License from project: LGPL import java.io.ByteArrayInputStream; import java.io.IOException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; public class Main { public static Element unmarshalDOMElement(String xmlValue) throws SAXException, IOException, ParserConfigurationException { return unmarshalDOMElement(xmlValue.getBytes()); }//from www. j ava2 s .c om public static Element unmarshalDOMElement(byte[] input) throws SAXException, IOException, ParserConfigurationException { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(new ByteArrayInputStream(input)); return doc.getDocumentElement(); } }