// other children are kept in an outer list, with the new node
// added at the appropriate location.
List<Tree> children = Generics.newArrayList();
List<Tree> innerChildren = Generics.newArrayList();
boolean insideSpan = false;
for (Tree child : parent.children()) {
if (child == startChild || child == endChild) {
if (!insideSpan && startChild != endChild) {
insideSpan = true;
innerChildren.add(child);
} else {