Rule - Changing child entity field in dependency on parent field value

How should I design the rule, that changes the IsLocked (child) field on change of the State field in parent?

Solution: Use the Complex Data Rule like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="AS date">

	<xsl:include href="model://e1c65fcd-118d-4eb3-9c2f-aa27fec132ba"/>

	<xsl:template match="ROOT">
			<xsl:apply-templates select="//ChildEntityName"/>

	<xsl:template match="ChildEntityName">
		  <xsl:copy-of select="@*"/>
			<xsl:attribute name="IsLocked">
				<xsl:value-of select="not(../@State=1)"/>
		  <xsl:copy-of select="*"/>

In this case, if the State in parent stays different from 1, the IsLocked field in child changes to True. If it changes to 1, it changes to False.