As long as XML that is being pulled out is a valid one, yes...  Otherwise it might be advisable to pipe it through something like Tidy to at least close out tags and replace &'s <'s, >'s, etc. with named entities.  If that "XML" is user-drivven, there might be a problem.