You don't display the output of using the two blocks shown as input, but I'm guessing the reason there is still a newline in the XML output when using the 2nd block as an input, is that there is a newline in the data. The 2nd <mp> tag contains the text "\ntext".
IndentPrinter changes formatting, but not the data payload of individual tags, i.e. it can change the parts between two tag declarations or two close tags, but not the parts between a tag declaration and it's close tag.
If you want to get rid of ALL newlines, you'll need to parse the XML, then process it to remove all newlines from the .text() portions of each tag, THEN output it using the IndexPrinter as you do.