//修改配置的配置文件,在其中增加sqlMap元素
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
DocumentBuilder ibatisConfigBuilder = factory.newDocumentBuilder();
InputStream inputStream = Resources.getResourceAsStream("SqlMapConfig.xml");
Document doc = ibatisConfigBuilder.parse(inputStream);
NodeList sqlMapElem = doc.getElementsByTagName("sqlMapConfig");
Element elem = doc.createElement("sqlMap");
elem.setAttribute("resource", "sqlMap.xml");
sqlMapElem.item(0).appendChild(elem);
Transformer trans = TransformerFactory.newInstance().newTransformer();
File tempFile = File.createTempFile("sqlMapConfig", ".xml");