use templates instead of saxon:serialize() function to serialize XML to string