Hello Goldie,
Do you mean using the XML logic or placing it into a udf causes the performance decrease?
Using the XML inline is a little bit difficult for whom do not use XML features of the SQL2005.
This format is not easy to implement.
Placing the logic in a udf makes the implementation easier.
Actually, I made a simple test to see that the xml function is quicker. But I do not say that this is always works in better performance. May be slower, and since you disagree, it is probably slower perhaps while working with high number of rows.