Putting each attribute on a new line during xml serialization
问题 Lets say I have a DOM object (or a string containing xml). Is it in any way possible to serialize the xml in such a way that each attribute appears on a new line? This is the output I want: <parent> <anElement attrOne="1" attrTwo="2" attrThree="3" /> </parent> Preferred if the solution a part of the standard java api, but I suspect such a feature is not available in there, or am I wrong? I found a property for a serializer in the .NET Framework, called NewLineOnAttributes. What I am searching