#!/bin/bash
s='Text start
... <field outputName="location"> ...
End of text.'
sed '/<field outputName="location".*>/s/.*//' <<< "$s"