Here you can find the source of string2Source(String xml)
public static Source string2Source(String xml)
//package com.java2s; //License from project: Apache License import java.io.StringReader; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; public class Main { public static Source string2Source(String xml) { System.out.println("xml:" + xml); return new StreamSource(new StringReader(xml)); }/* w ww. j ava 2s . c om*/ }