The most general problem in XML processing is getting text data from an element
with mixed contents, e.g. text, child, text, child etc. JDOM offers a simple
solution: it collects all text-sections and returns entire text at one time.
Besides if source XML is formatted, text data may contain a lot of whitespaces.
There is a way to trim extra spaces and get valid text: