将PHP与XML混合使用

I wonder if it's possible to mix XML with php. and i'll explain what I exactly mean:

Is it possible to mix between xml file (with the <?xml ... ?> prologue), and <?php ... ?> script? For example:

<?xml version="1.0" encoding="UTF-8"?>

<tag<?php if(isset($_GET['tag_attribute']) && !empty($_GET['tag_attribute'])) { echo ' ' . $_GET['tag_attribute']; } ?>>
</tag>

And in case something like this can be done, does it need to be created through php? perhaps I can create regular xml file and change its extension to .php?

thank you all

Well, It seems like i've found out that it is possible and how. all I needed to do is to create regular XML file with php extension and this php line above:

<?php header('Content-type: application/xml'); ?>