Is there an XML format for Lego?
Yes, there is LXFML - which is if you like an "offical" XML format for LEGO models - in that it's produced and maintained by The LEGO Group.

The .LXF format used by LEGO Digital Designer is a compressed archive containing a thumbnail in .png format and a model definition file in LFXML.

As I noted in the answer to that question, the LDD team have shared both the documentation and XSD for validating this.

Within the definition, there is scope for a &lt;BuildingInstructions&gt; element that can contain one or more &lt;BuildingInstruction&gt; elements. These in turn contain &lt;steps&gt; which reference one or more parts or contain sub-steps:

&lt;BuildingInstructions&gt;
  &lt;BuildingInstruction name="b6206_" cameraRefID="4"&gt;
    &lt;Step name="b6206_s1"&gt;
      &lt;Step name="b6206_s2"&gt;
        &lt;PartRef partRefID="0"/&gt;
      &lt;/Step&gt;
      &lt;PartRef partRefID="1"/&gt;
      &lt;PartRef partRefID="2"/&gt;
    &lt;/Step&gt;
    &lt;Step&gt;
      &lt;PartRef partRefID="3"/&gt;
    &lt;/Step&gt;
  &lt;/BuildingInstruction&gt;
&lt;/BuildingInstructions&gt;


Note that the &lt;PartRefs&gt; are Ids to parts in the &lt;Model&gt; elements, which define the actual element, colour and orientation.

The default steps created within LDD have been known to be a little hit and miss, adding multiple elements at once and not always visibly or in a valid order (although that may have improved since I last used it for step creation).