Rich Kilmer wrote: > <a> > <b><c>C</c>B</b> > <b>B</b> > </a> > > Rule: If all there is between tags is pure white space and sub-tags use > CR otherwise, don't change the formatting. Yeah, I think that's where I'm going. Atually, your example formatting clarifies something. You missed a "B" between <b> and <c>, so REXML would format /that/ this way: <a> <b> <c>C</c>B</b> <b>B</b> </a> If you read this back in, you'd get: <a>\n <b>\n <c>C</c>B</b>\n <b>B</b>\n</a> However, if you passed the document constructor the :ignore_whitespace_nodes, you'd get your original: <a><b><c>C</c>B</b><b>B</b></a> Notice that the /original/ source: <a> <b>B</b><c/> </a> Can not be pretty printed and read back in in a way that preserves the formatting. Pretty printing would introduce a newline between </b> and <c/>, and :ignore_whitespace_nodes would strip out the newlines after <a> and after <c/>. Still, I think this is a good compromise. --- SER