In situ elemental imaging of planetary surface regolith at a spatial resolution of 100s to 1000s of microns can provide evidence of the provenance of rocks or sediments and their habitability, and can identify post-depositional diagenetic alteration affecting preservation. We use high-resolution elemental maps and XRF spectra from MapX, a flight prototype in situ X-ray imaging instrument, to demonstrate this technology in rock types relevant to astrobiology. Examples are given for various petrologies and depositional/diagenetic environments, including ultramafic/mafic rocks, serpentinites, hydrothermal carbonates, evaporites, stromatolitic cherts and diagenetic concretions.