working copy with xpath working for vars and attributes