I have an HTML file in which all tags are in one line. I would like to separate each tag and put it on its own line. The end goal is to have a well-formed HTML file.
e.g.
<html><head><title>StackOverflow</title></head><body></body></html>
would be converted into:
<html>
<head>
<title>
StackOverflow
</title>
</head>
<body>
</body>
</html>
Is there an existing Java library that handles this already?