Added Logging. preg_replace is used more defensively in the xpath part
Modified node text modification