[HPT-140] Make provision for attached XML document

Early release for easy inspection.  Tests not ready yet.  (Bad!  Write tests first, Mark!)