It is compatible with XML... => http://www.w3.org/TR/REC-xml/#sec-white-space
An element value is a Text node, whose parent is the element.
In addition, does XML pretty printer sound familiar to you?
getProvides().getAny() should be enough to retrieve DOM elements and get values with formatting.
getExtension() is a utility method, that should be convenient. Removing surrounding spaces would make sense.
Otherwise, all the components should stop using this method in JBI and External listeners, and go through an internal model.
That's what I did in all my components (SCA, Jsr181, Validation, XSLT, Talend, Quartz), because this CDK method is not reliable.
It appears to be a problem in other components as well, and I'm sure all the component developers do not know it preserves surronding white spaces.
PS: I agree about Eclipse formatting automatically the XML.
I created this issue PETALSSTUD-94.
Sorry