function amf0encXmlDoc(str) { // Essentially it is the same as string
  let buf = Buffer.alloc(3);
  buf.writeUInt8(0x0F, 0);
  buf.writeUInt16BE(str.length, 1);
  return Buffer.concat([buf, Buffer.from(str, "utf8")]);
}
AMF0 Encode XMLDoc
@param {string} str
@returns {Buffer}