I am having a slight problem converting an Element object to String. Because I need a string that will be passed to a specific method. I tried using .toString () or using the String variable assigning it. None of the tests were correct. As we can easily convert, the string object should also show the exact XML structure as it shows for the element.
Element element = (Element) xmlList.item(i);
The above "element" object is displayed in XML format. I want to convert the same to String in XML format
source
share