code from eXist's trunk + test
ignore webapp folder