BUGFIX: Moved XML contents extractor to its own function as the XPath 'text()' function no longer works PHP >=5.4