when I run your query on my laptop getting this error:
Msg 9436, Level 16, State 1, Line 7
XML parsing: line 5, character 15, end tag does not match start tag
If your database contains objects with Unicode names, or executes raw SQL from a middle tier that can pass through Unicode characters, you might want to try this version of the query from the original article.
as xml) as DeadlockGraph
select cast(target_data as xml) as TargetData
from sys.dm_xe_session_targets st
join sys.dm_xe_sessions s on s.address = st.event_session_address
where name = 'system_health'
) as Data
cross apply TargetData.nodes ('//RingBufferTarget/event') as XEventData (XEvent)
where XEventData.XEvent.value('@name', 'nvarchar(4000)') = 'xml_deadlock_report'
If you're still experiencing errors please post the actual SQL statement that you're executing so that someone can help pinpoint the error for you.