Given the following XML snippet:
<adjustment>Add <bonus>10</bonus> points
if completion time less than
<adjustment>Add <bonus>15</bonus> points
if opponent rank is higher than level
<adjustment>Add <bonus>5</bonus> points if
the temperature is above <temperature>75</temperature>
How would I output each adjustment as text like the
following? In other words, how can I "flatten" the XML text?
Add 10 points if completion time less than 60 seconds.
Add 15 points if opponent rank is higher than level 5.
Add 5 points if the temperature is above 75 degrees
adjustments.text() returns an empty string, of course. And
something like adjustments.adjustment.text() returns just:
Add points if completion time less than seconds.
It doesn't have the text of of the child nodes.
What I need is the text of a parent node and all of the child
nodes in one string. Even if I iterate over the parent and all the
descendants, I don't see any way of properly placing the text from
the children into the text from the parent.