Try this
declare @xmlString VARCHAR(MAX) =' <customerdetail>
<customer>Test</customer>
<detail>Test Detail
<price />
</detail></customerdetail>'
SELECT CAST(@xmlString AS XML)
If above code returns any error then you can confirm the XML is invalid. If not it is valid.
Thank you