Output MSB-set aligned, delimited ASCII Write some code that takes a single string as input and outputs MSB-set aligned ASCII.

Only ASCII characters less than 128 (0x80) will be in the input. The output format is generated as follows:


For each character convert it to its binary representation, remove the MSB (always 0 in the input) and then add a delimiter-bit (X) to both ends. The value will now be 9 bits long and both begin and end in X
Output each character in order, MSB to LSB, making sure that the MSB of each output byte is either 1 or X
If the MSB of the next byte would normally be 0, output the fewest .s needed between two consecutive Xs to align the MSB with a 1 or X
Output the data as binary digits, with X for each delimiter and . for each padding bit
At the end of the data, write a . after the last X, then as many .s as necessary to complete the last byte
Separate each byte (group of 8 digits) with a single whitespace character (space, tab, newline, etc.)
A whitespace character at the end of the last output line is optional
Empty input must produce ........ as the output
Your code must work on any length strings that your language can handle and at least 255 characters


Input: Hello, World!

Bytes    -&gt; Delimited -&gt; * Output    Start and End of each character
01001000    X1001000X    X1001000    'H'
01100101    X1100101X    XX110010    'e'       'H'
01101100    X1101100X    1X.X1101    'l'       'e'
01101100    X1101100X    100XX110    'l'       'l'
01101111    X1101111X    1100X.X1    'o'       'l'
00101100    X0101100X    101111X.              'o'
00100000    X0100000X    X0101100    ','
01010111    X1010111X    X.....X0    ' '       ','
01101111    X1101111X    100000XX    'W'       ' '
01110010    X1110010X    1010111X              'W'
01101100    X1101100X    X1101111    'o'
01100100    X1100100X    X.X11100    'r'       'o'
00100001    X0100001X    10XX1101    'l'       'r'
                         100X..X1    'd'       'l'
                         100100X.              'd'
                         X0100001    '!'
                         X.......              '!'


The * marks the Most Significant Bit in the output. Each bit in this column is either 1 or X. Removing any number of .s would cause either a 0 or . in the MSB column. If the input was Hello, W the last byte output would be .........

As usual, lowest score wins!
Python 3, 144 140 131 130 137 bytes
Damn bugs :(
O=&quot;&quot;
for Q in input():
 C=&quot;X%07dX&quot;%int(bin(ord(Q))[2:])
 while&quot;1&quot;&gt;C[8-len(O)%8]:C=&quot;.&quot;+C
 O+=C
O+=&quot;.&quot;
while O:print((O+&quot;.&quot;*8)[:8]);O=O[8:]

This is really straight forward.
Ungolfed with explanation
# initialize output buffer
output = &quot;&quot;
# loop through input
for char in input():
    # get charcode, binary, remove 0b, parse as int, format
    code = &quot;X%07dX&quot; % int(bin(ord(char))[2:])
    # pad code while the line starting character would be 0
    while &quot;1&quot; &gt; code[8 - len(output) % 8]:
        code = &quot;.&quot; + code
    # append result to output buffer
    output += code
# add dot to ensure padding in end
output += &quot;.&quot;
# loop while any output is left
while output:
    # print line of output, with padding
    print((output + &quot;.&quot; * 8)[:8])
    # remove printed output
    output = output[8:]