I'm making a tree in XML::Twig, and trying to print out the elements (with their text) in the tree one at a time. I have a loop calling element->print, which prints out each element and all its nested children, but what I'd like to do is print out the element and its text without the nested children, since I have to add things to each element before I print it. I've looked through the perldoc and didn't see anything that seemed like it could do that; can anyone help me out?