getEncoding function

Determines the encoding for an XML document or node