XML Node to String Conversion for Large Sized XML
问题 Till now I was using DOMSource to transform the XML file into string, in my Android App. Here's my code : public String convertElementToString (Node element) throws TransformerConfigurationException, TransformerFactoryConfigurationError { Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //initialize StreamResult with File object to save to file StreamResult result = new StreamResult(new StringWriter());