decode input stream to xml string