How to serialize XML to UTF-8 (czech characters)

How to ensure that the text from the “name” attribute and others is converted to UTF-8?

czech chars - ěščřžýáíéůúťň …