Error in GPF graph for creating a new band from the multiband Geotiff image

I am new to GPF development. For learning purpose, I tried to create a new band using bandmath operator. I am trying to read a Geotiff from a directory with 4 bands in it (band1, band2, band3, band4 and all of them are in unint8) and I want to create a new image by putting a condition on band1 i.e. band1 < 200 and I want to save the output in a Geotiff format.
My XML is attached here, and the error message is also attached here.
GPF_Try.xml (663 Bytes)

gpt C:\Users\SAIPLANNER\Downloads\Slums_Naveen\GPF_Try.xml -t C:\Users\SAIPLANNER\Downloads\Slums_Naveen\slums.dim C:\Users\SAIPLANNER\Downloads\Slums_Naveen\New_slums_mumbai.tif
INFO: org.esa.snap.python.gpf.PyOperatorSpi: Python operator ‘S2RutOp’ registered (Python module: ‘s2_rut’, class: ‘S2RutOp’, root: ‘C:\Users\SAIPLANNER\AppData\Roaming\SNAP\modules\org-esa-snap-snap-rut.jar’)
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
com.thoughtworks.xstream.converters.ConversionException: : unexpected character in markup (position: START_TAG seen …band1 < … @13:33) : : unexpected character in markup (position: START_TAG seen …band1 < … @13:33)
---- Debugging information ----
message : : unexpected character in markup (position: START_TAG seen …band1 < … @13:33)
cause-exception : com.thoughtworks.xstream.io.StreamException
cause-message : : unexpected character in markup (position: START_TAG seen …band1 < … @13:33)
class : com.bc.ceres.binding.dom.DomElement
required-type : com.bc.ceres.binding.dom.DomElement
converter-type : com.bc.ceres.binding.dom.DomElementXStreamConverter
path : /graph/node/parameters/targetBands/targetBand/expression
line number : 13
class[1] : org.esa.snap.core.gpf.graph.Node
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
class[2] : org.esa.snap.core.gpf.graph.Graph
version : 1.4.8

    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:383)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1206)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1190)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1061)
    at org.esa.snap.core.gpf.graph.GraphIO.read(GraphIO.java:83)
    at org.esa.snap.core.gpf.main.DefaultCommandLineContext.readGraph(DefaultCommandLineContext.java:75)
    at org.esa.snap.core.gpf.main.CommandLineTool.readGraph(CommandLineTool.java:530)
    at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:342)
    at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:287)
    at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
    at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
    at org.esa.snap.core.gpf.main.GPT.run(GPT.java:54)
    at org.esa.snap.core.gpf.main.GPT.main(GPT.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.esa.snap.runtime.Launcher.lambda$run$14(Launcher.java:55)
    at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
    at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
    at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:62)
    at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:101)
    at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:16)

Caused by: com.thoughtworks.xstream.io.StreamException: : unexpected character in markup (position: START_TAG seen …band1 < … @13:33)
at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124)
at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:135)
at com.thoughtworks.xstream.io.xml.AbstractPullReader.getValue(AbstractPullReader.java:180)
at com.thoughtworks.xstream.io.ReaderWrapper.getValue(ReaderWrapper.java:48)
at com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:41)
at com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at com.bc.ceres.binding.dom.DomElementXStreamConverter.unmarshal(DomElementXStreamConverter.java:52)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
… 44 more
Caused by: org.xmlpull.v1.XmlPullParserException: unexpected character in markup (position: START_TAG seen …band1 < … @13:33)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1261)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109)
… 54 more

Error: : unexpected character in markup (position: START_TAG seen …band1 < … @13:33) : : unexpected character in markup (position: START_TAG seen …band1 < … @13:33)
---- Debugging information ----
message : : unexpected character in markup (position: START_TAG seen …band1 < … @13:33)
cause-exception : com.thoughtworks.xstream.io.StreamException
cause-message : : unexpected character in markup (position: START_TAG seen …band1 < … @13:33)
class : com.bc.ceres.binding.dom.DomElement
required-type : com.bc.ceres.binding.dom.DomElement
converter-type : com.bc.ceres.binding.dom.DomElementXStreamConverter
path : /graph/node/parameters/targetBands/targetBand/expression
line number : 13
class[1] : org.esa.snap.core.gpf.graph.Node
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
class[2] : org.esa.snap.core.gpf.graph.Graph
version : 1.4.8

Are you constructing the graph using the SNAP GUI?

Hi,
I moved your to the snap category. The GPF Graph category is intended for presenting working example graphs to others.

In an xml file you need to treat some characters special.
See here:

So your expression must look like:

<expression> band_1 &lt; 200<expression>

Please note, I’ve also changed the band name.

Also you need to remove the

<.../>

This shall only indicate that you can add multiple of the targetBand definitions.