a bit simplified and more general patching artifact tree walking and node handling