Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this FAQ
You can't and you don't. XML itself is not a programming language, so normal XML documents don't ‘run’ or ‘execute’. XML is a markup specification language and XML files are just data: they sit there until you run a program which displays them (like a browser) or does some work with them (like a converter which writes the data in another format, or a database which reads the data), or modifies them (like an editor).
XSLT2 and XSL:FO
The water is muddied by the fact that the most popular transformation processing languages (XSLT2 and XSL:FO) are actually written in XML syntax, because they are declarative, not procedural. In these special cases you can be said to ‘execute’ an XML file, by running a processing application like Saxon, which compiles the directives specified in the files into Java bytecode to process XML documents. In this sense, you could compare them with other programming languages, but you would be comparing the language facilities, not the XML syntax in which they are written.