Here you can find the source of getDocument(String strxml)
public static Document getDocument(String strxml)
//package com.java2s; import java.io.StringReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.xml.sax.InputSource; import android.util.Log; public class Main { public static Document getDocument(String strxml) { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance();// www. j a va 2 s. c o m try { DocumentBuilder builder = factory.newDocumentBuilder(); strxml = new String(strxml.getBytes(), "UTF-8"); StringReader stringReader = new StringReader(strxml); InputSource inputSource = new InputSource(stringReader); Document document = builder.parse(inputSource); return document; } catch (Exception e) { e.printStackTrace(); Log.e("xmlString2Document", "xml?????dom??????"); } return null; } }