private void sendStartStream() throws IOException {
   Tag stream = Tag.start("stream:stream");
   stream.setAttribute("from", account.getJid());
   stream.setAttribute("to", account.getServer());
   stream.setAttribute("version", "1.0");
   stream.setAttribute("xml:lang", "en");
   stream.setAttribute("xmlns", "jabber:client");
   stream.setAttribute("xmlns:stream", "http://etherx.jabber.org/streams");
   tagWriter.writeTag(stream);
 }
 private void sendStartTLS() throws IOException {
   Tag startTLS = Tag.empty("starttls");
   startTLS.setAttribute("xmlns", "urn:ietf:params:xml:ns:xmpp-tls");
   tagWriter.writeTag(startTLS);
 }