Refactored code for XML Examples EXPath Package