for //text() { if ((following-sibling::* or preceding-sibling::*) and xsh:match(., '^\s+$')) set . '' }