Implement meaningful text manipulation for arbitrary XPaths