Use an XML serializer instead of outerhtml so that this can work in IE