<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://example.com/schema2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.w3.org/2001/XMLSchema.xsd"
    targetNamespace="http://example.com/schema2"
    elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xsd:element name="root">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="node1" type="node1Type"/>
        <xsd:element name="node2" type="node2Type"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:group name="elementgroup">
    <xsd:sequence>
      <xsd:element name="group1" type="xsd:string"/>
      <xsd:element name="group2" type="xsd:string"/>
    </xsd:sequence>
  </xsd:group>

  <xsd:complexType name="node1Type">
    <xsd:sequence>
      <xsd:element name="node1node1" type="xsd:string"/>
      <xsd:group ref="elementgroup"/>
      <xsd:element name="node1node2" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="node2Type">
    <xsd:sequence>
      <xsd:element name="node2node1" type="xsd:string"/>
      <xsd:group ref="elementgroup"/>
      <xsd:element name="node2node2" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>

</xsd:schema>
