I created an XML document using Java in my android application. I have to call a web service in my application and pass this XML as an argument there. But my problem is ther
None of the other answers worked for me. I had to use the below code, to remove both additional whitespaces and new lines.
xmlString.trim().replace("\n", "").replaceAll("( *)<", "<")